aboutsummaryrefslogtreecommitdiff
path: root/lumina-wm-INCOMPLETE
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-04-25 11:22:07 -0400
committerKen Moore <moorekou@gmail.com>2016-04-25 11:22:07 -0400
commitba9680dae066300fcd8675894a9521b54ff0a126 (patch)
tree29f276185ee950b2d7c4be48b2e189778b86504e /lumina-wm-INCOMPLETE
parentCommit a few random changes on my dev system - just to sync up with the repo. (diff)
parentGet some more of the new WM functional. Still not ready to be used by the fai... (diff)
downloadlumina-ba9680dae066300fcd8675894a9521b54ff0a126.tar.gz
lumina-ba9680dae066300fcd8675894a9521b54ff0a126.tar.bz2
lumina-ba9680dae066300fcd8675894a9521b54ff0a126.zip
Merge branch 'master' of github.com:pcbsd/lumina
Diffstat (limited to 'lumina-wm-INCOMPLETE')
-rw-r--r--lumina-wm-INCOMPLETE/GlobalDefines.h4
-rw-r--r--lumina-wm-INCOMPLETE/LLockScreen.cpp2
-rw-r--r--lumina-wm-INCOMPLETE/LScreenSaver.cpp4
-rw-r--r--lumina-wm-INCOMPLETE/LWindow.cpp16
-rw-r--r--lumina-wm-INCOMPLETE/LWindow.h6
-rw-r--r--lumina-wm-INCOMPLETE/LWindowManager.cpp36
-rw-r--r--lumina-wm-INCOMPLETE/lumina-wm.pro4
7 files changed, 50 insertions, 22 deletions
diff --git a/lumina-wm-INCOMPLETE/GlobalDefines.h b/lumina-wm-INCOMPLETE/GlobalDefines.h
index 68cf927d..3ec278ac 100644
--- a/lumina-wm-INCOMPLETE/GlobalDefines.h
+++ b/lumina-wm-INCOMPLETE/GlobalDefines.h
@@ -59,7 +59,7 @@
#include <xcb/xcb_atom.h>
#include <xcb/xcb_aux.h> //included in libxcb-util.so
-#define ANIMTIME 100 //animation time in milliseconds
+#define ANIMTIME 80 //animation time in milliseconds
//Global flags/structures
namespace LWM{
//Flags/enumerations
@@ -71,4 +71,4 @@ namespace LWM{
-#endif \ No newline at end of file
+#endif
diff --git a/lumina-wm-INCOMPLETE/LLockScreen.cpp b/lumina-wm-INCOMPLETE/LLockScreen.cpp
index de95aac8..4cc6d68b 100644
--- a/lumina-wm-INCOMPLETE/LLockScreen.cpp
+++ b/lumina-wm-INCOMPLETE/LLockScreen.cpp
@@ -7,6 +7,8 @@
#include "LLockScreen.h"
#include "ui_LLockScreen.h"
+#include <unistd.h>
+
#define NUMTRIES 3
#define WAITMINS 1
#define DEBUG 1
diff --git a/lumina-wm-INCOMPLETE/LScreenSaver.cpp b/lumina-wm-INCOMPLETE/LScreenSaver.cpp
index 7a2105f8..dd7eb6dc 100644
--- a/lumina-wm-INCOMPLETE/LScreenSaver.cpp
+++ b/lumina-wm-INCOMPLETE/LScreenSaver.cpp
@@ -8,7 +8,7 @@
#include <QScreen>
#include <QApplication>
-#define DEBUG 0
+#define DEBUG 1
LScreenSaver::LScreenSaver() : QWidget(0,Qt::BypassWindowManagerHint | Qt::WindowStaysOnTopHint){
starttimer = new QTimer(this);
@@ -178,4 +178,4 @@ void LScreenSaver::SSFinished(){
SSLocked = false;
HideLockScreen();
HideScreenSaver();
-} \ No newline at end of file
+}
diff --git a/lumina-wm-INCOMPLETE/LWindow.cpp b/lumina-wm-INCOMPLETE/LWindow.cpp
index ee7f7592..84ff2ffd 100644
--- a/lumina-wm-INCOMPLETE/LWindow.cpp
+++ b/lumina-wm-INCOMPLETE/LWindow.cpp
@@ -91,18 +91,17 @@ void LWindowFrame::InitWindow(){
VL->setContentsMargins(1,1,2,2);
VL->setSpacing(0);
//Have the window take the same initial size of the client window
- qDebug() << " - Load Size Hints";
+ QRect geom = LWM::SYSTEM->WM_Window_Geom(CID);
+ qDebug() << " - Load Size Hints" << "initial size:" << geom.size();
icccm_size_hints SH = LWM::SYSTEM->WM_ICCCM_GetNormalHints(CID);
qDebug() << " - - Got Normal Hints";
if(!SH.isValid()){ SH = LWM::SYSTEM->WM_ICCCM_GetSizeHints(CID); }
qDebug() << " - - Start resizing...";
- if(SH.base_width>=0 && SH.base_height>=0){ this->resize(SH.base_width, SH.base_height); }
- else if(SH.min_width>=0 && SH.min_height>=0){ this->resize(SH.min_width, SH.min_height); }
- else if(SH.width>=0 && SH.height>=0){ this->resize(SH.width, SH.height); }
- else{
- QRect geom = LWM::SYSTEM->WM_Window_Geom(CID);
- this->setGeometry( geom );
- }
+ if(SH.base_width>geom.width() && SH.base_height>geom.height()){ this->resize(SH.base_width, SH.base_height); }
+ else if(SH.min_width>geom.width() && SH.min_height>geom.height()){ this->resize(SH.min_width, SH.min_height); }
+ else if(SH.width>geom.width() && SH.height>geom.height()){ this->resize(SH.width, SH.height); }
+ else if(geom.isNull()){ this->resize(100,80); }
+ else{ this->resize( geom.size() ); }
qDebug() << " - done";
//Now embed the native window into the frame
@@ -404,6 +403,7 @@ void LWindowFrame::mousePressEvent(QMouseEvent *ev){
offset.setX(0); offset.setY(0);
if(activeState != Normal){ return; } // do nothing - already in a state of grabbed mouse
this->activateWindow();
+ LWM::SYSTEM->WM_Set_Active_Window(CID);
if(this->childAt(ev->pos())!=0){
//Check for any non-left-click event and skip it
if(ev->button()!=Qt::LeftButton){ return; }
diff --git a/lumina-wm-INCOMPLETE/LWindow.h b/lumina-wm-INCOMPLETE/LWindow.h
index d2495467..ceefca83 100644
--- a/lumina-wm-INCOMPLETE/LWindow.h
+++ b/lumina-wm-INCOMPLETE/LWindow.h
@@ -80,9 +80,9 @@ private:
WId CID;
LWindowFrame *FID;
bool needsFrame(QList<LXCB::WINDOWTYPE> list){
- if(list.isEmpty()){ return true; } //assume a normal window (fallback)
+ if(list.isEmpty()){ return !LWM::SYSTEM->WM_ICCCM_GetClass(CID).contains("Lumina-DE"); } //assume a normal window (fallback)
return !(list.contains(LXCB::T_DESKTOP) || list.contains(LXCB::T_DOCK) || list.contains(LXCB::T_TOOLBAR) \
- || list.contains(LXCB::T_UTILITY) || list.contains(LXCB::T_SPLASH) || list.contains(LXCB::T_DROPDOWN_MENU) \
+ || list.contains(LXCB::T_SPLASH) || list.contains(LXCB::T_DROPDOWN_MENU) \
|| list.contains(LXCB::T_TOOLTIP) || list.contains(LXCB::T_POPUP_MENU) || list.contains(LXCB::T_TOOLTIP) \
|| list.contains(LXCB::T_COMBO) || list.contains(LXCB::T_DND) );
}
@@ -111,4 +111,4 @@ public:
LWindowFrame* frame(){ return FID; }
};
-#endif \ No newline at end of file
+#endif
diff --git a/lumina-wm-INCOMPLETE/LWindowManager.cpp b/lumina-wm-INCOMPLETE/LWindowManager.cpp
index 725bc18e..14ce6897 100644
--- a/lumina-wm-INCOMPLETE/LWindowManager.cpp
+++ b/lumina-wm-INCOMPLETE/LWindowManager.cpp
@@ -17,6 +17,22 @@ LWindowManager::~LWindowManager(){
}
bool LWindowManager::start(){
+ //Setup the initial screen/session values
+ LWM::SYSTEM->WM_Set_Root_Supported();
+ LWM::SYSTEM->WM_SetNumber_Desktops(1);
+ LWM::SYSTEM->WM_Set_Current_Desktop(0);
+ LWM::SYSTEM->WM_Set_Desktop_Names(QStringList() << "one");
+ QRect totgeom;
+ QList<QPoint> viewports;
+ QList<QRect> geoms;
+ for(int i=0; i<QApplication::desktop()->screenCount(); i++){
+ geoms << QApplication::desktop()->screen(i)->geometry();
+ viewports << QPoint(0,0);
+ totgeom = QApplication::desktop()->screen(i)->geometry();
+ }
+ LWM::SYSTEM->WM_Set_Desktop_Geometry(totgeom.size());
+ LWM::SYSTEM->WM_Set_Desktop_Viewport(viewports);
+ LWM::SYSTEM->WM_Set_Workarea(geoms);
//Should probably do a quick loop over any existing windows with the root as parent (just in case)
QList<WId> initial = LWM::SYSTEM->WM_RootWindows();
for(int i=0; i<initial.length(); i++){
@@ -55,6 +71,7 @@ void LWindowManager::NewWindow(WId win, bool requested){
if(!ok){ return; }
}
if(DEBUG){ qDebug() << "New Managed Window:" << LWM::SYSTEM->WM_ICCCM_GetClass(win); }
+ LWM::SYSTEM->WM_Set_Active_Window(win);
LWindow *lwin = new LWindow(win);
connect(lwin, SIGNAL(Finished(WId)), this, SLOT(FinishedWindow(WId)) );
WINS << lwin;
@@ -69,10 +86,8 @@ void LWindowManager::ClosedWindow(WId win){
for(int i=0; i<WINS.length(); i++){
if(WINS[i]->clientID()==win){
qDebug() << " - Closed Window";
- if(WINS[i]->hasFrame()){ WINS[i]->frame()->windowChanged(LWM::Closed); }
- else{
- FinishedWindow(win);
- }
+ if(WINS[i]->hasFrame()){ WINS[i]->frame()->windowChanged(LWM::Closed); } //do any animations/cleanup
+ else{ FinishedWindow(win); }
break;
}
}
@@ -117,6 +132,14 @@ void LWindowManager::RestackWindows(){
else{ Stack_Normal << id; }
}
}
+ //Active Window management
+ WId active = LWM::SYSTEM->WM_Get_Active_Window();
+ if(Stack_Desktop.contains(active)){ Stack_Desktop.removeAll(active); Stack_Desktop << active; }
+ else if(Stack_Below.contains(active)){ Stack_Below.removeAll(active); Stack_Below << active; }
+ else if(Stack_Normal.contains(active)){ Stack_Normal.removeAll(active); Stack_Normal << active; }
+ else if(Stack_Above.contains(active)){ Stack_Above.removeAll(active); Stack_Above << active; }
+ else if(Stack_Fullscreen.contains(active)){ Stack_Fullscreen.removeAll(active); Stack_Fullscreen << active; }
+
//Now set the root properties for these lists
LWM::SYSTEM->WM_Set_Client_List(currwins, false); //age-ordered version
LWM::SYSTEM->WM_Set_Client_List(QList<WId>() << Stack_Desktop << Stack_Below << Stack_Normal << Stack_Above << Stack_Fullscreen, true); //stacking order version
@@ -150,6 +173,11 @@ void LWindowManager::FinishedWindow(WId win){
for(int i=0; i<WINS.length(); i++){
if(WINS[i]->clientID() == win){
qDebug() << " - Finished Window";
+ if(win == LWM::SYSTEM->WM_Get_Active_Window()){
+ if(i==0 && WINS.length()>1){ LWM::SYSTEM->WM_Set_Active_Window(WINS[i+1]->clientID()); }
+ else if(i>0){ LWM::SYSTEM->WM_Set_Active_Window(WINS[i-1]->clientID()); }
+ else{ LWM::SYSTEM->WM_Set_Active_Window( QX11Info::appRootWindow()); }
+ }
delete WINS.takeAt(i); break;
}
}
diff --git a/lumina-wm-INCOMPLETE/lumina-wm.pro b/lumina-wm-INCOMPLETE/lumina-wm.pro
index 0fb27d39..4424e199 100644
--- a/lumina-wm-INCOMPLETE/lumina-wm.pro
+++ b/lumina-wm-INCOMPLETE/lumina-wm.pro
@@ -4,14 +4,12 @@ QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets x11extras
TARGET = lumina-wm
-target.path = $$PREFIX/bin
+target.path = $${L_BINDIR}
LIBS += -lLuminaUtils -lxcb -lxcb-damage -lxcb-composite -lxcb-screensaver -lxcb-util
DEPENDPATH += ../libLumina
-TEMPLATE = app
-
SOURCES += main.cpp \
WMSession.cpp \
LScreenSaver.cpp \
bgstack15