diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/view.c | 5 | ||||
-rw-r--r-- | source/xcb.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source/view.c b/source/view.c index d28dea75..0ebcd4bd 100644 --- a/source/view.c +++ b/source/view.c @@ -846,6 +846,11 @@ void __create_window ( MenuFlags menu_flags ) window_set_atom_prop ( box_window, xcb->ewmh._NET_WM_STATE, atoms, sizeof ( atoms ) / sizeof ( xcb_atom_t ) ); } + xcb_atom_t protocols[] = { + netatoms[WM_TAKE_FOCUS] + }; + xcb_icccm_set_wm_protocols ( xcb->connection, box_window, xcb->ewmh.WM_PROTOCOLS, G_N_ELEMENTS ( protocols ), protocols ); + TICK_N ( "setup window fullscreen" ); // Set the WM_NAME rofi_view_set_window_title ( "rofi" ); diff --git a/source/xcb.c b/source/xcb.c index c07fb38d..3ad31a92 100644 --- a/source/xcb.c +++ b/source/xcb.c @@ -891,6 +891,18 @@ static void main_loop_x11_event_handler_view ( xcb_generic_event_t *event ) switch ( event->response_type & ~0x80 ) { + case XCB_CLIENT_MESSAGE: + { + xcb_client_message_event_t *cme = (xcb_client_message_event_t *) event; + xcb_atom_t atom = cme->data.data32[0]; + xcb_timestamp_t time = cme->data.data32[1]; + if ( atom == netatoms[WM_TAKE_FOCUS] ) + { + xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_NONE, cme->window, time ); + xcb_flush ( xcb->connection ); + } + break; + } case XCB_EXPOSE: rofi_view_frame_callback (); break; |