Use the EWMH support window rather than the root window as an input focus fallback.
If no other window is available on the active workspace, we now select the EWMH support window (used to indicate that an EWMH-compliant window manager is preent) as the focus window rather than the root window. The NET_WM_ACTIVE window will still be set to XCB_WINDOW_NONE to pretend that no window is actually focused. This fixes the issue that when using the root window, a fallback mechanism in X11 takes effect which routes keyboard input to the window under the cursor, independent of whether that window has the input focus. Using the EWMH window instead, we can avoid this behavior. We cannot simply set it to XCB_WINDOW_NONE as this would discard all keyboard events, breaking keybindings. fixes #1378
This commit is contained in:
@ -37,6 +37,15 @@ extern bool debug_build;
|
||||
extern int listen_fds;
|
||||
extern xcb_connection_t *conn;
|
||||
extern int conn_screen;
|
||||
/**
|
||||
* The EWMH support window that is used to indicate that an EWMH-compliant
|
||||
* window manager is present. This window is created when i3 starts and
|
||||
* kept alive until i3 exits.
|
||||
* We also use this window as the focused window if no other window is
|
||||
* available to be focused on the active workspace in order to prevent
|
||||
* keyboard focus issues (see #1378).
|
||||
*/
|
||||
extern xcb_window_t ewmh_window;
|
||||
/** The last timestamp we got from X11 (timestamps are included in some events
|
||||
* and are used for some things, like determining a unique ID in startup
|
||||
* notification). */
|
||||
|
Reference in New Issue
Block a user