diff options
author | Ken Moore <ken@ixsystems.com> | 2017-02-02 10:19:27 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-02-02 10:19:27 -0500 |
commit | 27b86ceed595c55457b3c30a7a7a7836756c46b0 (patch) | |
tree | aa3456a607bfbdeb7369ec57b687c3675de3bfcc /src-qt5/core/libLumina/LuminaX11.cpp | |
parent | Another large batch of work on Lumina2: (diff) | |
download | lumina-27b86ceed595c55457b3c30a7a7a7836756c46b0.tar.gz lumina-27b86ceed595c55457b3c30a7a7a7836756c46b0.tar.bz2 lumina-27b86ceed595c55457b3c30a7a7a7836756c46b0.zip |
Clean up the window activate XCB function. Now it should send the window a client message asking it to take focus properly as well.
Diffstat (limited to 'src-qt5/core/libLumina/LuminaX11.cpp')
-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 |