aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaX11.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-11-12 11:37:01 -0500
committerKen Moore <moorekou@gmail.com>2015-11-12 11:37:01 -0500
commitaa5f07d00e44be25992e0271d2f814f354c08009 (patch)
tree320f008b8d9a0f6400ecf0d889afed741277e254 /libLumina/LuminaX11.cpp
parentFinish adding the rest of the Root window EWMH standards support into the Lum... (diff)
downloadlumina-aa5f07d00e44be25992e0271d2f814f354c08009.tar.gz
lumina-aa5f07d00e44be25992e0271d2f814f354c08009.tar.bz2
lumina-aa5f07d00e44be25992e0271d2f814f354c08009.zip
Add ~50% of the client EWMH window property support.
Diffstat (limited to 'libLumina/LuminaX11.cpp')
-rw-r--r--libLumina/LuminaX11.cpp69
1 files changed, 68 insertions, 1 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp
index 048333b4..a5592c8e 100644
--- a/libLumina/LuminaX11.cpp
+++ b/libLumina/LuminaX11.cpp
@@ -1504,15 +1504,82 @@ void LXCB::WM_Set_Window_Supported(WId win){
}
// _NET_WM_NAME
+QString LXCB::WM_Get_Name(WId win){
+ xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name_unchecked(&EWMH, win);
+ xcb_ewmh_get_utf8_strings_reply_t reply;
+ QString out;
+ if(1==xcb_ewmh_get_wm_name_reply(&EWMH, cookie,&reply, NULL) ){
+ out = QString::fromUtf8(reply.strings);
+ }
+ return out;
+}
+void LXCB::WM_Set_Name(WId win, QString txt){
+ xcb_ewmh_set_wm_name(&EWMH, win, txt.length(), txt.toUtf8().data());
+}
// _NET_WM_VISIBLE_NAME
+QString LXCB::WM_Get_Visible_Name(WId win){
+ xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_visible_name_unchecked(&EWMH, win);
+ xcb_ewmh_get_utf8_strings_reply_t reply;
+ QString out;
+ if(1==xcb_ewmh_get_wm_visible_name_reply(&EWMH, cookie,&reply, NULL) ){
+ out = QString::fromUtf8(reply.strings);
+ }
+ return out;
+}
+void LXCB::WM_Set_Visible_Name(WId win, QString txt){
+ xcb_ewmh_set_wm_visible_name(&EWMH, win, txt.length(), txt.toUtf8().data());
+}
// _NET_WM_ICON_NAME
+QString LXCB::WM_Get_Icon_Name(WId win){
+ xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_icon_name_unchecked(&EWMH, win);
+ xcb_ewmh_get_utf8_strings_reply_t reply;
+ QString out;
+ if(1==xcb_ewmh_get_wm_icon_name_reply(&EWMH, cookie,&reply, NULL) ){
+ out = QString::fromUtf8(reply.strings);
+ }
+ return out;
+}
+void LXCB::WM_Set_Icon_Name(WId win, QString txt){
+ xcb_ewmh_set_wm_icon_name(&EWMH, win, txt.length(), txt.toUtf8().data());
+}
// _NET_WM_VISIBLE_ICON_NAME
+QString LXCB::WM_Get_Visible_Icon_Name(WId win){
+ xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_visible_icon_name_unchecked(&EWMH, win);
+ xcb_ewmh_get_utf8_strings_reply_t reply;
+ QString out;
+ if(1==xcb_ewmh_get_wm_visible_icon_name_reply(&EWMH, cookie,&reply, NULL) ){
+ out = QString::fromUtf8(reply.strings);
+ }
+ return out;
+}
+void LXCB::WM_Set_Visible_Icon_Name(WId win, QString txt){
+ xcb_ewmh_set_wm_visible_icon_name(&EWMH, win, txt.length(), txt.toUtf8().data());
+}
// _NET_WM_DESKTOP
-
+int LXCB::WM_Get_Desktop(WId win){
+ //returns -1 if window on all desktops
+ xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_desktop_unchecked(&EWMH, win);
+ uint32_t num = 0;
+ int out = -1;
+ if(1==xcb_ewmh_get_wm_desktop_reply(&EWMH, cookie, &num, NULL) ){
+ if(num!=0xFFFFFFFF){ out = num; }
+ }else{
+ //Error in fetching property (not set?)
+ // - put it on the current screen
+ out = WM_Get_Current_Desktop();
+ }
+ return out;
+}
+
+void LXCB::WM_Set_Desktop(WId win, int num){
+ //use -1 to set it for all desktops
+ xcb_ewmh_set_wm_desktop(&EWMH, win, (num<0 ? 0xFFFFFFFF : qAbs(num) ) );
+}
+
// _NET_WM_WINDOW_TYPE
// _NET_WM_STATE
bgstack15