]> git.sur5r.net Git - i3/i3/commitdiff
Support _NET_ACTIVE_WINDOW ClientMessages
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 7 Aug 2012 07:50:47 +0000 (09:50 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 7 Aug 2012 07:50:47 +0000 (09:50 +0200)
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

index 7d8e1e25ddf093b8ad8037b1e2519517034c3cc6..2e1e04db58f20500ce3d7534595edcc73e915655 100644 (file)
@@ -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];