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_WINDOW_HIDDEN flag is inaccurate. #2234

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

SDL_WINDOW_HIDDEN flag is inaccurate. #2234

SDLBugzilla opened this issue Feb 11, 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: 2.0.4
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2016-08-17 15:15:04 +0000, Jason Wyatt wrote:

Created attachment 2550
Demo for incorrect hidden/shown state

After hiding the window, SDL_WINDOW_HIDDEN/SDL_WINDOW_SHOWN flags on a window are correctly updated. However on the next SDL_PumpEvents, they are set incorrectly.

This appears to be because X11_GetNetWMState does not check whether the _NET_WM_STATE property exists (it shouldn't on unmapped windows, see https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317598336). This results in an empty list of atoms for the state, which would imply that the window is not hidden.

(Seen on Fedora 24, Gnome)

On 2016-08-17 17:04:10 +0000, Jason Wyatt wrote:

Created attachment 2551
Quick patch.

Checking that the property exists, and if it doesn't, setting the SDL_WINDOW_HIDDEN flag, fixes the issue for me.

On 2017-07-20 13:07:25 +0000, Dan Ginsburg wrote:

Created attachment 2802
Alternate patch for this bug, the original proposed patch did not work for me

On 2017-07-20 13:10:33 +0000, Dan Ginsburg wrote:

More details on my proposed patch: I am on Kubuntu 16.04.2. I ran into this same bug, but with Jason's patch I found that actualType != None was true so the SDL_WINDOW_HIDDEN would still not be set. My fix instead is to explicitly check for whether the window is unmapped rather than relying on the returned values in XGetWindowProperty.

On 2017-07-20 17:53:19 +0000, Sam Lantinga wrote:

Thanks Dan, I accepted your patch.
https://hg.libsdl.org/SDL/rev/7cfe088fafba

Jason, can you check the latest build and see if that fixes your issue?

On 2017-07-21 08:36:23 +0000, Jason Wyatt wrote:

Yes, this fixes the issue for me too. Thanks.

(In reply to Sam Lantinga from comment # 4)

Thanks Dan, I accepted your patch.
https://hg.libsdl.org/SDL/rev/7cfe088fafba

Jason, can you check the latest build and see if that fixes your issue?

On 2017-07-21 16:50:23 +0000, Sam Lantinga wrote:

Great, thanks!

On 2017-11-14 14:46:15 +0000, Max Reitz wrote:

*** Bug 2818 has been marked as a duplicate of this bug. ***

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