From fa4894fbaafb48c2b0ae95e206fafde6beab4c67 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 7 Aug 2012 09:50:47 +0200 Subject: [PATCH] Support _NET_ACTIVE_WINDOW ClientMessages Since we advertise _NET_ACTIVE_WINDOW support (but only set the corresponding atom currently), it makes sense to also support the ClientMessage. Apps such as Gajim use it to set focus to the roster window when clicking on the tray icon for example. fixes #767 --- src/handlers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/handlers.c b/src/handlers.c index 7d8e1e25..2e1e04db 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -621,6 +621,16 @@ static void handle_client_message(xcb_client_message_event_t *event) { con_toggle_fullscreen(con, CF_OUTPUT); } + tree_render(); + } else if (event->type == A__NET_ACTIVE_WINDOW) { + DLOG("_NET_ACTIVE_WINDOW: Window 0x%08x should be activated\n", event->window); + Con *con = con_by_window_id(event->window); + if (con == NULL) { + DLOG("Could not get window for client message\n"); + return; + } + + con_focus(con); tree_render(); } else if (event->type == A_I3_SYNC) { xcb_window_t window = event->data.data32[0]; -- 2.39.2