Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_GetAppState not returning correct values if ALT+TAB used in application #582

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.14
Reported for operating system, platform: Windows 7, Other

Comments on the original bug report:

On 2010-07-28 12:59:27 +0000, wrote:

Again another bug I encountered on Windows 7:

Assuming I hide my mouse cusor with SDL_ShowCursor(SDL_DISABLE).
Now if my app runs on Fullscreen, I tend to "get out" of it using ALT+TAB. This will minimize the app. However SDL_GetAppState will STILL report SDL_APPACTIVE, SDL_APPINPUTFOCUS and SDL_APPMOUSEFOCUS.

Also if I check event.active.gain, this seems (as much as I could find out) to be set twice (first 0 then 1 again) while going out of the app with ALT+TAB. I am not perfectly sure here but even if the app is minimized because of ALT+TAB (or also CTRL+ESC), event.active.gain is 1.

On 2011-04-28 17:19:26 +0000, Alex Volkov wrote:

This happens with the windib driver. Windows posts the WM_ACTIVATE WA_INACTIVE event with minimized==false when you Alt+Tab out of a fullscreen app. Responding to this event, wincommon/SDL_sysevents.c:WinMessage() calls ShowWindow(,SW_MINIMIZE) via SDL_RestoreDesktopMode, but another WM_ACTIVATE event is not posted in response to that.
Whatever the case may be, WinMessage() should just treat a fullscreen app receiving WA_INACTIVE the same as a minimized app. Additionally, it's probably a good idea to clear SDL_APPMOUSEFOCUS at the same time, and that should take care of bug # 1035.

On 2011-04-28 17:31:38 +0000, Alex Volkov wrote:

Created attachment 605
Patch to fix this bug and bug 1035.

On 2011-12-29 01:30:37 +0000, Sam Lantinga wrote:

Fixed, thanks!
http://hg.libsdl.org/SDL/rev/676a54593bc4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant