X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fxcb.c;h=7382cc615efe91f718890c812e2b9e38e91a86f3;hb=82e286ed7c20f269e1a225c2ce082cf6a33a140b;hp=aaad590d97a871fc33a0fafced0722496d8d1a89;hpb=0639a7d95ba29229db7d545ad758ca6946ad293d;p=i3%2Fi3 diff --git a/src/xcb.c b/src/xcb.c index aaad590d..7382cc61 100644 --- a/src/xcb.c +++ b/src/xcb.c @@ -206,6 +206,26 @@ void fake_absolute_configure_notify(Con *con) { fake_configure_notify(conn, absolute, con->window->id); } +/* + * Sends the WM_TAKE_FOCUS ClientMessage to the given window + * + */ +void send_take_focus(xcb_window_t window) { + xcb_client_message_event_t ev; + + memset(&ev, 0, sizeof(xcb_client_message_event_t)); + + ev.response_type = XCB_CLIENT_MESSAGE; + ev.window = window; + ev.type = A_WM_PROTOCOLS; + ev.format = 32; + ev.data.data32[0] = A_WM_TAKE_FOCUS; + ev.data.data32[1] = XCB_CURRENT_TIME; + + DLOG("Sending WM_TAKE_FOCUS to the client\n"); + xcb_send_event(conn, false, window, XCB_EVENT_MASK_NO_EVENT, (char*)&ev); +} + /* * Finds out which modifier mask is the one for numlock, as the user may change this. *