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
This commit is contained in:
Michael Stapelberg 2012-08-07 09:50:47 +02:00
parent 122130d868
commit fa4894fbaa
1 changed files with 10 additions and 0 deletions

View 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];