| Summary: | X11 never gets focus event without a Window Manager | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ryan C. Gordon <icculus> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | benoit.pierre, eimacdude |
| Version: | HG 2.0 | Keywords: | target-2.0.4 |
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | fix window manager detection | ||
This is now fixed in https://hg.libsdl.org/SDL/rev/aa4e4768c6c1 --ryan. *** Bug 2993 has been marked as a duplicate of this bug. *** Created attachment 2211 [details] fix window manager detection My SDL application does not start with this fix: - my window manager is awesome (http://awesome.naquadah.org/) - I get the following error: 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. Typo in my last comment: the patch gets rid of X11_HasWindowManager. Thanks, your patch has been applied! https://hg.libsdl.org/SDL/rev/025e28f516ce |
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.