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

X11 never gets focus event without a Window Manager #1870

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

X11 never gets focus event without a Window Manager #1870

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: HG 2.0
Reported for operating system, platform: Linux, All

Comments on the original bug report:

On 2015-05-29 17:47:39 +0000, Ryan C. Gordon wrote:

If you have no window manager running, SDL apps never get a FocusIn event, so they never think they have keyboard focus.

As reported here:

https://answers.unrealengine.com/questions/231361/keyboard-doesnt-work-without-display-manager-gnome.html#answer-232306

Apparently Chromium reacts to MapNotify to handle this scenario:
http://src.chromium.org/svn/branches/1312/src/ui/aura/root_window_host_linux.cc

StackOverflow confirms:
http://stackoverflow.com/questions/26863470/sdl2-input-focus

Must fix for 2.0.4.

--ryan.

On 2015-05-29 19:22:46 +0000, Ryan C. Gordon wrote:

This is now fixed in https://hg.libsdl.org/SDL/rev/aa4e4768c6c1

--ryan.

On 2015-05-31 06:06:30 +0000, Ryan C. Gordon wrote:

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

On 2015-07-03 10:57:14 +0000, Benoit Pierre wrote:

Created attachment 2211
fix window manager detection

My SDL application does not start with this fix:

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 42 (X_SetInputFocus)
Serial number of failed request: 189
Current serial number in output stream: 190

It seems the window manager detection code in X11_HasWindowManager does not detect awesome. The code mentions Chromium has being the source of the method, but after checking out the latest version, I could not find it. Instead, the latest version of Chromium is using _NET_SUPPORTING_WM_CHECK, which seems more in-line with the freedesktop documentation (http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472693600). In fact, the exact same method is already used in the SDL X11 video subsystem implementation (see X11_CheckWindowManager).

Consequently, the attached patch gets rid of X11_CheckWindowManager and reuse the result of the checks in X11_CheckWindowManager.

Tested both without a window manager, and with awesome and openbox.

On 2015-07-03 10:59:00 +0000, Benoit Pierre wrote:

Typo in my last comment: the patch gets rid of X11_HasWindowManager.

On 2015-07-03 16:20:37 +0000, Sam Lantinga wrote:

Thanks, your patch has been applied!
https://hg.libsdl.org/SDL/rev/025e28f516ce

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