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 - Provide a way to get first mouse click event causing focus gain
Summary: Provide a way to get first mouse click event causing focus gain
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.8
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-23 18:42 UTC by Ellie
Modified: 2018-08-30 13:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!