summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2020-03-26 13:45:45 +0100
committerQuentin Glidic <sardemff7+git@sardemff7.net>2020-11-27 07:26:17 +0100
commit1c9d975dd2aff1794c6484465482c796c41a1358 (patch)
treef3c1cb4fa7a0023f4cf8cdffdc4721ed8e6b834d
parent627bd435103462bd08337754c13990270fa428b3 (diff)
xcb: Steal focus in O-R mode
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
-rw-r--r--source/view.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/view.c b/source/view.c
index 0ebcd4bd..0cd146a4 100644
--- a/source/view.c
+++ b/source/view.c
@@ -1894,6 +1894,13 @@ RofiViewState *rofi_view_create ( Mode *sw,
xcb_map_window ( xcb->connection, CacheState.main_window );
widget_queue_redraw ( WIDGET ( state->main_window ) );
xcb_flush ( xcb->connection );
+
+ /* When Override Redirect, the WM will not let us know we can take focus, so just steal it */
+ if ( ( ( menu_flags & MENU_NORMAL_WINDOW ) == 0 ) ) {
+ xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_NONE, CacheState.main_window, XCB_CURRENT_TIME );
+ xcb_flush ( xcb->connection );
+ }
+
if ( xcb->sncontext != NULL ) {
sn_launchee_context_complete ( xcb->sncontext );
}