diff --git a/awesome.c b/awesome.c index 4e092e694..3f5d6fbb3 100644 --- a/awesome.c +++ b/awesome.c @@ -107,7 +107,7 @@ awesome_atexit(bool restart) * Work around this by placing the focus where we like it to be. */ xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_POINTER_ROOT, - XCB_NONE, XCB_CURRENT_TIME); + XCB_NONE, globalconf.timestamp); xcb_aux_sync(globalconf.connection); xkb_free(); @@ -266,7 +266,7 @@ acquire_WM_Sn(bool replace) /* Acquire the selection */ xcb_set_selection_owner(globalconf.connection, globalconf.selection_owner_window, - globalconf.selection_atom, XCB_CURRENT_TIME); + globalconf.selection_atom, globalconf.timestamp); if (get_sel_reply->owner != XCB_NONE) { /* Wait for the old owner to go away */ @@ -286,7 +286,7 @@ acquire_WM_Sn(bool replace) ev.window = globalconf.screen->root; ev.format = 32; ev.type = MANAGER; - ev.data.data32[0] = XCB_CURRENT_TIME; + ev.data.data32[0] = globalconf.timestamp; ev.data.data32[1] = globalconf.selection_atom; ev.data.data32[2] = globalconf.selection_owner_window; ev.data.data32[3] = ev.data.data32[4] = 0; diff --git a/event.c b/event.c index de60131d8..230966685 100644 --- a/event.c +++ b/event.c @@ -221,7 +221,7 @@ event_handle_button(xcb_button_press_event_t *ev) if(ev->child == XCB_NONE) xcb_allow_events(globalconf.connection, XCB_ALLOW_ASYNC_POINTER, - XCB_CURRENT_TIME); + ev->time); } else if((c = client_getbyframewin(ev->event)) || (c = client_getbywin(ev->event))) { @@ -263,7 +263,7 @@ event_handle_button(xcb_button_press_event_t *ev) } xcb_allow_events(globalconf.connection, XCB_ALLOW_REPLAY_POINTER, - XCB_CURRENT_TIME); + ev->time); } else if(ev->child == XCB_NONE) if(globalconf.screen->root == ev->event) @@ -837,6 +837,10 @@ event_handle_randr_output_change_notify(xcb_randr_notify_event_t *ev) xcb_randr_get_output_info_reply_t *info = NULL; lua_State *L = globalconf_get_lua_State(); + /* The following explicitly uses XCB_CURRENT_TIME since we want to know + * the final state of the connection. There could be more notification + * events underway and using some "old" timestamp causes problems. + */ info = xcb_randr_get_output_info_reply(globalconf.connection, xcb_randr_get_output_info_unchecked(globalconf.connection, output, diff --git a/root.c b/root.c index 968cbba1e..52c149bc0 100644 --- a/root.c +++ b/root.c @@ -276,7 +276,7 @@ luaA_root_fake_input(lua_State *L) xcb_test_fake_input(globalconf.connection, type, detail, - XCB_CURRENT_TIME, + 0, /* This is a delay, not a timestamp! */ XCB_NONE, x, y, 0); diff --git a/systray.c b/systray.c index cb1f4bec6..aa2b11009 100644 --- a/systray.c +++ b/systray.c @@ -90,7 +90,7 @@ systray_register(void) ev.window = xscreen->root; ev.format = 32; ev.type = MANAGER; - ev.data.data32[0] = XCB_CURRENT_TIME; + ev.data.data32[0] = globalconf.timestamp; ev.data.data32[1] = globalconf.systray.atom; ev.data.data32[2] = globalconf.systray.window; ev.data.data32[3] = ev.data.data32[4] = 0; @@ -98,7 +98,7 @@ systray_register(void) xcb_set_selection_owner(globalconf.connection, globalconf.systray.window, globalconf.systray.atom, - XCB_CURRENT_TIME); + globalconf.timestamp); xcb_send_event(globalconf.connection, false, xscreen->root, 0xFFFFFF, (char *) &ev); } @@ -116,7 +116,7 @@ systray_cleanup(void) xcb_set_selection_owner(globalconf.connection, XCB_NONE, globalconf.systray.atom, - XCB_CURRENT_TIME); + globalconf.timestamp); xcb_unmap_window(globalconf.connection, globalconf.systray.window);