aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-DE/LWinInfo.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-04 16:44:55 -0500
committerKen Moore <ken@ixsystems.com>2017-01-04 16:44:55 -0500
commit25b2e77aa2395ba9143683a5ce1a27b99ee7a211 (patch)
treebbd732bb72689b9b46dfc619d3d0e1748f7e435b /src-qt5/core/lumina-desktop-unified/src-DE/LWinInfo.cpp
parentTag version 1.2.1 on the master branch in preparation for new changes from th... (diff)
downloadlumina-25b2e77aa2395ba9143683a5ce1a27b99ee7a211.tar.gz
lumina-25b2e77aa2395ba9143683a5ce1a27b99ee7a211.tar.bz2
lumina-25b2e77aa2395ba9143683a5ce1a27b99ee7a211.zip
Create a new "lumina-desktop-unified" core subproject (DO NOT USE)
This is just a staging area for the merging of the desktop, window manager, etc.. into a single unified application. It is highly fragmented right now and will not build *AT ALL* for a while.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-DE/LWinInfo.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-DE/LWinInfo.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-DE/LWinInfo.cpp b/src-qt5/core/lumina-desktop-unified/src-DE/LWinInfo.cpp
new file mode 100644
index 00000000..6a6cea0b
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/src-DE/LWinInfo.cpp
@@ -0,0 +1,48 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2014, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+#include "LWinInfo.h"
+
+#include <LuminaX11.h>
+
+#include "LSession.h"
+
+//Information Retrieval
+ // Don't cache these results because they can change regularly
+QString LWinInfo::text(){
+ if(window==0){ return ""; }
+ QString nm = LSession::handle()->XCB->WindowVisibleIconName(window);
+ if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->WindowIconName(window); }
+ if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->WindowVisibleName(window); }
+ if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->WindowName(window); }
+ if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->OldWindowIconName(window); }
+ if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->OldWindowName(window); }
+ //Make sure that the text is a reasonable size (40 char limit)
+ //if(nm.length()>40){ nm = nm.left(40)+"..."; }
+ return nm;
+}
+
+QIcon LWinInfo::icon(bool &noicon){
+ if(window==0){ noicon = true; return QIcon();}
+ noicon = false;
+ QIcon ico = LSession::handle()->XCB->WindowIcon(window);
+ //Check for a null icon, and supply one if necessary
+ if(ico.isNull()){ ico = LXDG::findIcon( this->Class().toLower(),""); }
+ if(ico.isNull()){ico = LXDG::findIcon("preferences-system-windows",""); noicon=true;}
+ return ico;
+}
+
+QString LWinInfo::Class(){
+ return LSession::handle()->XCB->WindowClass(window);
+}
+
+LXCB::WINDOWVISIBILITY LWinInfo::status(bool update){
+ if(window==0){ return LXCB::IGNORE; }
+ if(update || cstate == LXCB::IGNORE){
+ cstate = LSession::handle()->XCB->WindowState(window);
+ }
+ return cstate;
+}
bgstack15