aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaX11.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-03-15 19:13:29 -0400
committerKen Moore <ken@pcbsd.org>2015-03-15 19:13:29 -0400
commite03f0f89495b076804435c100a1458a0a0092a55 (patch)
tree132a39fe304aa65f87b02bdaba5dab521ba70611 /libLumina/LuminaX11.cpp
parentAdd the ability to increase/decrease the icon size for the applauncher deskto... (diff)
downloadlumina-e03f0f89495b076804435c100a1458a0a0092a55.tar.gz
lumina-e03f0f89495b076804435c100a1458a0a0092a55.tar.bz2
lumina-e03f0f89495b076804435c100a1458a0a0092a55.zip
Add support for the older WM_NAME and WM_ICON_NAME standards in addition to the EWMH standards (_NET_WM_NAME, etc..)
Diffstat (limited to 'libLumina/LuminaX11.cpp')
-rw-r--r--libLumina/LuminaX11.cpp36
1 files changed, 31 insertions, 5 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp
index 199dd6ed..43d4e577 100644
--- a/libLumina/LuminaX11.cpp
+++ b/libLumina/LuminaX11.cpp
@@ -1012,7 +1012,7 @@ LXCB::WINDOWSTATE LXCB::WindowState(WId win){
}
// === WindowVisibleIconName() ===
-QString LXCB::WindowVisibleIconName(WId win){ //_WM_VISIBLE_ICON_NAME
+QString LXCB::WindowVisibleIconName(WId win){ //_NET_WM_VISIBLE_ICON_NAME
QString out;
xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_visible_icon_name_unchecked(&EWMH, win);
if(cookie.sequence == 0){ return out; }
@@ -1024,7 +1024,7 @@ QString LXCB::WindowVisibleIconName(WId win){ //_WM_VISIBLE_ICON_NAME
}
// === WindowIconName() ===
-QString LXCB::WindowIconName(WId win){ //_WM_ICON_NAME
+QString LXCB::WindowIconName(WId win){ //_NET_WM_ICON_NAME
QString out;
xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_icon_name_unchecked(&EWMH, win);
if(cookie.sequence == 0){ return out; }
@@ -1036,7 +1036,7 @@ QString LXCB::WindowIconName(WId win){ //_WM_ICON_NAME
}
// === WindowVisibleName() ===
-QString LXCB::WindowVisibleName(WId win){ //_WM_VISIBLE_NAME
+QString LXCB::WindowVisibleName(WId win){ //_NET_WM_VISIBLE_NAME
QString out;
xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_visible_name_unchecked(&EWMH, win);
if(cookie.sequence == 0){ return out; }
@@ -1048,7 +1048,7 @@ QString LXCB::WindowVisibleName(WId win){ //_WM_VISIBLE_NAME
}
// === WindowName() ===
-QString LXCB::WindowName(WId win){ //_WM_NAME
+QString LXCB::WindowName(WId win){ //_NET_WM_NAME
QString out;
xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name_unchecked(&EWMH, win);
if(cookie.sequence == 0){ return out; }
@@ -1059,6 +1059,32 @@ QString LXCB::WindowName(WId win){ //_WM_NAME
return out;
}
+// === OldWindowName() ===
+QString LXCB::OldWindowName(WId win){ //WM_NAME (old standard)
+ xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_name_unchecked(QX11Info::connection(), win);
+ xcb_icccm_get_text_property_reply_t reply;
+ if(1 == xcb_icccm_get_wm_name_reply(QX11Info::connection(), cookie, &reply, NULL) ){
+ QString name = QString::fromLocal8Bit(reply.name);
+ xcb_icccm_get_text_property_reply_wipe(&reply);
+ return name;
+ }else{
+ return "";
+ }
+}
+
+// === OldWindowIconName() ===
+QString LXCB::OldWindowIconName(WId win){ //WM_ICON_NAME (old standard)
+ xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_icon_name_unchecked(QX11Info::connection(), win);
+ xcb_icccm_get_text_property_reply_t reply;
+ if(1 == xcb_icccm_get_wm_icon_name_reply(QX11Info::connection(), cookie, &reply, NULL) ){
+ QString name = QString::fromLocal8Bit(reply.name);
+ xcb_icccm_get_text_property_reply_wipe(&reply);
+ return name;
+ }else{
+ return "";
+ }
+}
+
// === WindowIsMaximized() ===
bool LXCB::WindowIsMaximized(WId win){
//See if the _NET_WM_STATE_MAXIMIZED_[VERT/HORZ] flags are set on the window
@@ -1348,4 +1374,4 @@ void LXCB::MoveResizeWindow(WId win, QRect geom){
xcb_ewmh_set_workarea(&EWMH, 0, desks, dareas); //_NET_WORKAREA
//Make sure to clear that reply
xcb_ewmh_get_workarea_reply_wipe(&work);
-}*/ \ No newline at end of file
+}*/
bgstack15