* Sends the WM_TAKE_FOCUS ClientMessage to the given window
*
*/
-void send_take_focus(xcb_window_t window);
+void send_take_focus(xcb_window_t window, xcb_timestamp_t timestamp);
/**
* Raises the given window (typically client->frame) above all other windows
focused->window->needs_take_focus) {
DLOG("Updating focus by sending WM_TAKE_FOCUS to window 0x%08x (focused: %p / %s)\n",
to_focus, focused, focused->name);
- send_take_focus(to_focus);
+ send_take_focus(to_focus, last_timestamp);
set_focus = !focused->window->doesnt_accept_focus;
DLOG("set_focus = %d\n", set_focus);
* Sends the WM_TAKE_FOCUS ClientMessage to the given window
*
*/
-void send_take_focus(xcb_window_t window) {
+void send_take_focus(xcb_window_t window, xcb_timestamp_t timestamp) {
/* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
* In order to properly initialize these bytes, we allocate 32 bytes even
* though we only need less for an xcb_configure_notify_event_t */
ev->type = A_WM_PROTOCOLS;
ev->format = 32;
ev->data.data32[0] = A_WM_TAKE_FOCUS;
- ev->data.data32[1] = XCB_CURRENT_TIME;
+ ev->data.data32[1] = timestamp;
DLOG("Sending WM_TAKE_FOCUS to the client\n");
xcb_send_event(conn, false, window, XCB_EVENT_MASK_NO_EVENT, (char*)ev);