diff options
author | Ken Moore <moorekou@gmail.com> | 2016-04-25 13:08:12 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-04-25 13:08:12 -0400 |
commit | ed5ecf7ea7a482b4649e66ecb35fbc60af680684 (patch) | |
tree | acc0fa17d228259e847f55c678db9fb0a9b50f0c /src-qt5/core/lumina-wm-INCOMPLETE/WMSession.cpp | |
parent | Merge branch 'master' of github.com:pcbsd/lumina (diff) | |
download | lumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.tar.gz lumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.tar.bz2 lumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.zip |
Rearrange the Lumina source tree quite a bit:
Now the utilites are arranged by category (core, core-utils, desktop-utils), so all the -utils may be excluded by a package system (or turned into separate packages) as needed.
Diffstat (limited to 'src-qt5/core/lumina-wm-INCOMPLETE/WMSession.cpp')
-rw-r--r-- | src-qt5/core/lumina-wm-INCOMPLETE/WMSession.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-wm-INCOMPLETE/WMSession.cpp b/src-qt5/core/lumina-wm-INCOMPLETE/WMSession.cpp new file mode 100644 index 00000000..4a7c6e02 --- /dev/null +++ b/src-qt5/core/lumina-wm-INCOMPLETE/WMSession.cpp @@ -0,0 +1,62 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "WMSession.h" + +#define DEBUG 1 +// ========== +// PUBLIC +// ========== +WMSession::WMSession(){ + if(DEBUG){ qDebug() << "Creating Event Filter..."; } + EFILTER = new EventFilter(); + if(DEBUG){ qDebug() << "Creating Screen Saver..."; } + SS = new LScreenSaver(); + if(DEBUG){ qDebug() << "Creating Window Manager..."; } + WM = new LWindowManager(); + EVThread = new QThread(); + EFILTER->moveToThread(EVThread); + //Setup connections + connect(EFILTER, SIGNAL(NewInputEvent()), SS, SLOT(newInputEvent()) ); + connect(EFILTER, SIGNAL(NewManagedWindow(WId)), WM, SLOT(NewWindow(WId)) ); + connect(EFILTER, SIGNAL(WindowClosed(WId)), WM, SLOT(ClosedWindow(WId)) ); + connect(EFILTER, SIGNAL(ModifyWindow(WId, LWM::WindowAction)), WM, SLOT(ModifyWindow(WId,LWM::WindowAction)) ); + connect(SS, SIGNAL(StartingScreenSaver()), EFILTER, SLOT(StartedSS()) ); + connect(SS, SIGNAL(ClosingScreenSaver()), EFILTER, SLOT(StoppedSS()) ); + connect(WM, SIGNAL(NewFullScreenWindows(QList<WId>)), EFILTER, SLOT(FullScreenChanged(QList<WId>)) ); +} + +WMSession::~WMSession(){ +} + +void WMSession::start(bool SSONLY){ + //Get the screensaver initialized/ready + if(DEBUG){ qDebug() << "Starting Screen Saver..."; } + SS->start(); + if(SSONLY){ return; } + //Now start pulling/filtering events + if(DEBUG){ qDebug() << "Starting Window Manager..."; } + WM->start(); + if(DEBUG){ qDebug() << "Starting Event Filter..."; } + EVThread->start(); + EFILTER->start(); + if(DEBUG){ qDebug() << "Done Starting WM session..."; } +} + +// ========== +// Public Slots +// ========== +void WMSession::reloadIcons(){ + +} + +void WMSession::newInputsAvailable(QStringList inputs){ + for(int i=0; i<inputs.length(); i++){ + if(inputs[i]=="--lock-now" || inputs[i]=="--test-ss"){ + QTimer::singleShot(0,SS, SLOT(LockScreenNow()) ); + } + } +} |