diff options
-rw-r--r-- | src-qt5/core/libLumina/LuminaX11.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src-qt5/core/libLumina/LuminaX11.cpp b/src-qt5/core/libLumina/LuminaX11.cpp index c586790b..ee882f7f 100644 --- a/src-qt5/core/libLumina/LuminaX11.cpp +++ b/src-qt5/core/libLumina/LuminaX11.cpp @@ -1611,18 +1611,21 @@ WId LXCB::WM_Get_Active_Window(){ void LXCB::WM_Set_Active_Window(WId win){ xcb_ewmh_set_active_window(&EWMH, QX11Info::appScreen(), win); //Also send the active window a message to take input focus - xcb_client_message_event_t event; + //Send the window a WM_TAKE_FOCUS message + if(atoms.isEmpty()){ createWMAtoms(); } //need these atoms + xcb_client_message_event_t event; event.response_type = XCB_CLIENT_MESSAGE; event.format = 32; - event.window = win; //window to activate + event.window = win; event.type = ATOMS[atoms.indexOf("WM_PROTOCOLS")]; - event.data.data32[0] = ATOMS[atoms.indexOf("WM_TAKE_FOCUS")]; - event.data.data32[1] = QX11Info::getTimestamp(); //current timestamp + event.data.data32[0] = ATOMS[atoms.indexOf("WM_TAKE_FOCUS")]; + event.data.data32[1] = XCB_TIME_CURRENT_TIME; //CurrentTime; event.data.data32[2] = 0; event.data.data32[3] = 0; event.data.data32[4] = 0; - xcb_send_event(QX11Info::connection(), 0, win, XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *) &event); + xcb_send_event(QX11Info::connection(), 0, win, XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *) &event); + xcb_flush(QX11Info::connection()); } // _NET_WORKAREA |