]> git.sur5r.net Git - i3/i3/blobdiff - src/xcb.c
Send last event timestamp with WM_TAKE_FOCUS msg
[i3/i3] / src / xcb.c
index caa203f71208a331a622d73f23e8475d493c4d36..3039b030ce5b44eae5ea77cfbc3974a13c43a633 100644 (file)
--- a/src/xcb.c
+++ b/src/xcb.c
@@ -110,7 +110,7 @@ void fake_absolute_configure_notify(Con *con) {
  * 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 */
@@ -122,7 +122,7 @@ void send_take_focus(xcb_window_t window) {
     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);