We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4237

Summary: Provide a way to get first mouse click event causing focus gain
Product: SDL Reporter: Ellie <etc0de>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.8   
Hardware: x86_64   
OS: Linux   

Description Ellie 2018-08-23 18:42:42 UTC
When an SDL_Window (not full screen, decorated) is visible but in background, first mouse click causes focus gain but no mouse click event. While this can be useful for windowed games, this is highly undesirable and confusing for any other graphical app since nothing else, e.g. anything Qt/GTK+-based, behaves like that.

Can this be turned off? Or maybe remove it altogether, given any game could easily implement to drop the first mouse click that happens less than ~2-3ms after a focus gain event if this behavior is desired.
Comment 1 Sam Lantinga 2018-08-28 20:02:10 UTC
Yes, you can set SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH to "1"
Comment 2 Ellie 2018-08-30 13:00:13 UTC
Oh sorry, seems my google-fu failed me there. Sorry about the unnecessary ticket!