From: Michael Stapelberg Date: Tue, 7 Aug 2012 07:50:47 +0000 (+0200) Subject: Support _NET_ACTIVE_WINDOW ClientMessages X-Git-Tag: 4.3~121 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fa4894fbaafb48c2b0ae95e206fafde6beab4c67;p=i3%2Fi3 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 --- 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];