aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-09-24 08:43:44 -0400
committerKen Moore <moorekou@gmail.com>2015-09-24 08:43:44 -0400
commit9df1ec84188e337af87cbfd6778e8b83b209fce8 (patch)
tree99591905dbc77e29b407eaefb01a6352d4184d6a
parentMake sure that a directory does not refresh more than once a second from a fi... (diff)
downloadlumina-9df1ec84188e337af87cbfd6778e8b83b209fce8.tar.gz
lumina-9df1ec84188e337af87cbfd6778e8b83b209fce8.tar.bz2
lumina-9df1ec84188e337af87cbfd6778e8b83b209fce8.zip
Adjust the window workspace detection routine to also check whether the given window is "sticky" in which case it always returns the current workspace.
-rw-r--r--libLumina/LuminaX11.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp
index 4780f8e0..392d22db 100644
--- a/libLumina/LuminaX11.cpp
+++ b/libLumina/LuminaX11.cpp
@@ -178,9 +178,17 @@ unsigned int LXCB::WindowWorkspace(WId win){
//qDebug() << "Get Window Workspace";
if(win==0){ return 0; }
uint32_t wkspace = 0;
+ xcb_get_property_cookie_t scookie = xcb_ewmh_get_wm_state_unchecked(&EWMH, win);
xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_desktop_unchecked(&EWMH, win);
if(cookie.sequence == 0){ return wkspace; }
xcb_ewmh_get_wm_desktop_reply(&EWMH, cookie, &wkspace, NULL);
+ xcb_ewmh_get_atoms_reply_t reply;
+ if(1==xcb_ewmh_get_wm_state_reply(&EWMH,scookie, &reply, NULL)){
+ //Also check if this window is "sticky", in which case return the current workspace (on all of them)
+ for(unsigned int i=0; i<reply.atoms_len; i++){
+ if(reply.atoms[i]==EWMH._NET_WM_STATE_STICKY){ wkspace = LXCB::CurrentWorkspace(); break; }
+ }
+ }
//qDebug() << " - done: " << wkspace;
return wkspace;
}
bgstack15