From ac4dd2a253d5e7aa5972d80d49cf643ac0111e6a Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 12 Nov 2015 14:25:06 -0500 Subject: Add a couple more XCB EWMH functions. One change required a re-definition of an enumeration (WINDOWSTATE -> WINDOWVISIBILITY), so I fixed the usage of that enum in the lumina-desktop project as well. --- libLumina/LuminaX11.cpp | 133 ++++++++++++++++++++++++++++++++++++++++++++++-- libLumina/LuminaX11.h | 12 ++++- 2 files changed, 139 insertions(+), 6 deletions(-) (limited to 'libLumina') diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp index a5592c8e..d9dab41c 100644 --- a/libLumina/LuminaX11.cpp +++ b/libLumina/LuminaX11.cpp @@ -287,13 +287,13 @@ QList LXCB::WindowFrameGeometry(WId win){ } // === WindowState() === -LXCB::WINDOWSTATE LXCB::WindowState(WId win){ +LXCB::WINDOWVISIBILITY LXCB::WindowState(WId win){ if(DEBUG){ qDebug() << "XCB: WindowState()"; } if(win==0){ return IGNORE; } xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_state_unchecked(&EWMH, win); if(cookie.sequence == 0){ return IGNORE; } xcb_ewmh_get_atoms_reply_t states; - WINDOWSTATE cstate = IGNORE; + WINDOWVISIBILITY cstate = IGNORE; //First Check for special states (ATTENTION in particular); if( 1 == xcb_ewmh_get_wm_state_reply(&EWMH, cookie, &states, NULL) ){ for(unsigned int i=0; i LXCB::WM_Get_Window_Type(WId win){ + // Note: This will silently discard any unknown/non-standard window type flags + // The client should ensure to set at least one standardized type flag per the specifications. + QList out; + xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_window_type_unchecked(&EWMH, win); + xcb_ewmh_get_atoms_reply_t reply; + if(1==xcb_ewmh_get_wm_window_type_reply(&EWMH, cookie, &reply, NULL) ){ + for(unsigned int i=0; i list){ + //Convert to the XCB format + xcb_atom_t array[list.length()]; + for(int i=0; i LXCB::WM_Get_Window_States(WId win){ + QList out; + xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_state_unchecked(&EWMH, win); + xcb_ewmh_get_atoms_reply_t reply; + if(1==xcb_ewmh_get_wm_state_reply(&EWMH, cookie, &reply, NULL) ){ + for(unsigned int i=0; i list){ + //Convert to the XCB format + xcb_atom_t array[list.length()]; + for(int i=0; i WindowFrameGeometry(WId win); //Returns: [top,bottom,left,right] sizes of the frame - WINDOWSTATE WindowState(WId win); //Visible state of window + LXCB::WINDOWVISIBILITY WindowState(WId win); //Visible state of window QString WindowVisibleIconName(WId win); //_NET_WM_VISIBLE_ICON_NAME QString WindowIconName(WId win); //_NET_WM_ICON_NAME QString WindowVisibleName(WId win); //_NET_WM_VISIBLE_NAME @@ -261,8 +264,13 @@ public: void WM_Set_Desktop(WId win, int num); //use -1 to set it for all desktops // _NET_WM_WINDOW_TYPE + // Note: While this returns a list, they are ordered by priority for WM usage (use the first one known about) + QList WM_Get_Window_Type(WId win); + void WM_Set_Window_Type(WId win, QList list); // _NET_WM_STATE + QList WM_Get_Window_States(WId win); + void WM_Set_Window_States(WId win, QList list); // _NET_WM_ALLOWED_ACTIONS -- cgit