aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lumina-wm-INCOMPLETE/LScreenSaver.cpp10
-rw-r--r--lumina-wm-INCOMPLETE/LXcbEventFilter.cpp31
-rw-r--r--lumina-wm-INCOMPLETE/SSBaseWidget.cpp10
-rw-r--r--lumina-wm-INCOMPLETE/WMSession.cpp10
-rw-r--r--lumina-wm-INCOMPLETE/WMSession.h2
-rw-r--r--lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h2
-rw-r--r--lumina-wm-INCOMPLETE/animations/SampleAnimation.h22
-rw-r--r--lumina-wm-INCOMPLETE/main.cpp7
8 files changed, 54 insertions, 40 deletions
diff --git a/lumina-wm-INCOMPLETE/LScreenSaver.cpp b/lumina-wm-INCOMPLETE/LScreenSaver.cpp
index 3b1d5e6a..62221abb 100644
--- a/lumina-wm-INCOMPLETE/LScreenSaver.cpp
+++ b/lumina-wm-INCOMPLETE/LScreenSaver.cpp
@@ -8,6 +8,8 @@
#include <QScreen>
#include <QApplication>
+#define DEBUG 1
+
LScreenSaver::LScreenSaver() : QWidget(0,Qt::BypassWindowManagerHint | Qt::WindowStaysOnTopHint){
starttimer = new QTimer(this);
starttimer->setSingleShot(true);
@@ -36,7 +38,7 @@ bool LScreenSaver::isLocked(){
// ===========
void LScreenSaver::start(){
reloadSettings(); //setup all the initial time frames
-
+ starttimer->start(1000);// one second delay (for testing)
}
void LScreenSaver::reloadSettings(){
@@ -81,6 +83,7 @@ void LScreenSaver::newInputEvent(){
// PRIVATE SLOTS
// ===========
void LScreenSaver::ShowScreenSaver(){
+ if(DEBUG){ qDebug() << "Showing Screen Saver:" << QDateTime::currentDateTime().toString(); }
SSRunning = true;
//Start the lock timer if necessary
if(!SSLocked && (settings->value("lockdelaymin",10).toInt()>0) ){ locktimer->start(); }
@@ -114,12 +117,14 @@ void LScreenSaver::ShowScreenSaver(){
}
void LScreenSaver::ShowLockScreen(){
- SSLocked = true;
+ if(DEBUG){ qDebug() << "Locking Screen Saver:" << QDateTime::currentDateTime().toString(); }
+ //SSLocked = true;
//Start the timer for hiding the lock screen due to inactivity
if(settings->value("hidesecs",15).toInt() > 0 ){ hidetimer->start(); }
}
void LScreenSaver::HideScreenSaver(){
+ if(DEBUG){ qDebug() << "Hiding Screen Saver:" << QDateTime::currentDateTime().toString(); }
SSRunning = false;
if(!SSLocked){
this->hide();
@@ -129,5 +134,6 @@ void LScreenSaver::HideScreenSaver(){
}
void LScreenSaver::HideLockScreen(){
+ if(DEBUG){ qDebug() << "Hiding Lock Screen:" << QDateTime::currentDateTime().toString(); }
//Leave the Locked flag set (still locked, just not visible)
}
diff --git a/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp b/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp
index 00639a27..ba825b90 100644
--- a/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp
+++ b/lumina-wm-INCOMPLETE/LXcbEventFilter.cpp
@@ -6,15 +6,19 @@
//===========================================
#include "LXcbEventFilter.h"
-//For all the XCB interactions and atoms
-// is accessed via
-// XCB->EWMH.(atom name)
-// XCB->(do something)
+//==================================================
+// NOTE: All the XCB interactions and atoms are accessed via:
+// LWM::SYSTEM->EWMH.(atom name)
+// LWM::SYSTEM->(do something)
+// (LWM::SYSTEM is the global XCB structure)
+//==================================================
+
#include <LuminaX11.h>
#include <QDebug>
//#include <xcb/screensaver.h>
+#define DEBUG 1
// Also keep the root window/screen around for use in the filters
namespace L_XCB{
xcb_screen_t *root_screen;
@@ -29,22 +33,11 @@ EventFilter::EventFilter() : QObject(){
}
void EventFilter::start(){
+ if(DEBUG){ qDebug() << " - Install event filter..."; }
QCoreApplication::instance()->installNativeEventFilter(EF);
- xcb_generic_error_t *status;
- xcb_connection_t *my_connection;
- xcb_void_cookie_t window_attributes;
- const unsigned int *returned;
- //Also ensure it gets root window events
-
- //Need the "real" root window (not the virtual root which Qt might return
- my_connection = QX11Info::connection();
- returned = (uint32_t *) ROOT_EVENT_MASK;
- window_attributes = xcb_change_window_attributes_checked(my_connection, L_XCB::root, XCB_CW_EVENT_MASK, returned);
- status = xcb_request_check(my_connection, window_attributes);
-
- // if( 0!= xcb_request_check( QX11Info::connection(), xcb_change_window_attributes_checked(QX11Info::connection(), L_XCB::root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK} ) ) ){
- if (status)
- {
+ if(DEBUG){ qDebug() << " - Run request check..."; }
+ xcb_generic_error_t *status = xcb_request_check( QX11Info::connection(), xcb_change_window_attributes_checked(QX11Info::connection(), L_XCB::root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK} ) );
+ if(status){
qCritical() << "[ERROR] Unable to setup WM event retrieval. Is another WM running?";
exit(1);
}
diff --git a/lumina-wm-INCOMPLETE/SSBaseWidget.cpp b/lumina-wm-INCOMPLETE/SSBaseWidget.cpp
index 3371c5e2..4beb905f 100644
--- a/lumina-wm-INCOMPLETE/SSBaseWidget.cpp
+++ b/lumina-wm-INCOMPLETE/SSBaseWidget.cpp
@@ -7,6 +7,8 @@
#include "SSBaseWidget.h"
+#define DEBUG 1
+
static QStringList validPlugs;
// ========
// PUBLIC
@@ -39,6 +41,7 @@ void SSBaseWidget::startPainting(){
if(valid.isEmpty()){ cplug = "none"; } //no known plugins
else{ cplug = valid[ qrand()%valid.length() ]; } //grab a random plugin
}
+ if(DEBUG){ qDebug() << " - Screen Saver:" << cplug; }
//Now list all the various plugins and start them appropriately
QString style;
if(cplug=="none"){
@@ -50,10 +53,15 @@ void SSBaseWidget::startPainting(){
if(cplug!="none"){
ANIM = BaseAnimGroup::NewAnimation(cplug, this, settings);
connect(ANIM, SIGNAL(finished()), this, SLOT(startPainting()) ); //repeat the plugin as needed
+ ANIM->LoadAnimations();
}
//Now start the animation(s)
if(ANIM!=0){
- if(ANIM->animationCount()>0){ ANIM->start(); }
+ //if(DEBUG){ qDebug() << " - Starting SS Plugin:" << cplug << ANIM->animationCount() << ANIM->duration() << ANIM->loopCount(); }
+ if(ANIM->animationCount()>0){
+ if(DEBUG){ qDebug() << " - Starting SS Plugin:" << cplug << ANIM->animationCount() << ANIM->duration() << ANIM->loopCount(); }
+ ANIM->start();
+ }
}
}
diff --git a/lumina-wm-INCOMPLETE/WMSession.cpp b/lumina-wm-INCOMPLETE/WMSession.cpp
index b9011d8c..23dd963a 100644
--- a/lumina-wm-INCOMPLETE/WMSession.cpp
+++ b/lumina-wm-INCOMPLETE/WMSession.cpp
@@ -6,11 +6,14 @@
//===========================================
#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();
//Setup connections
@@ -20,12 +23,15 @@ WMSession::WMSession(){
WMSession::~WMSession(){
}
-void WMSession::start(){
+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 Event Filter..."; }
EFILTER->start();
-
+ if(DEBUG){ qDebug() << "Done Starting WM session..."; }
}
// ==========
diff --git a/lumina-wm-INCOMPLETE/WMSession.h b/lumina-wm-INCOMPLETE/WMSession.h
index d90bafea..575a61e7 100644
--- a/lumina-wm-INCOMPLETE/WMSession.h
+++ b/lumina-wm-INCOMPLETE/WMSession.h
@@ -18,7 +18,7 @@ public:
WMSession();
~WMSession();
- void start();
+ void start(bool SSONLY = false);
private:
//XCB Event Watcher
diff --git a/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h b/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h
index 05c36ea2..dd7269d4 100644
--- a/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h
+++ b/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h
@@ -23,8 +23,6 @@ public:
BaseAnimGroup(QWidget *parent, QSettings *set){
canvas = parent;
settings = set;
- //Now load the animations for this particular plugin
- LoadAnimations();
}
~BaseAnimGroup(){}
diff --git a/lumina-wm-INCOMPLETE/animations/SampleAnimation.h b/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
index 8e513426..7b027ce7 100644
--- a/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
+++ b/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
@@ -14,29 +14,31 @@
class SampleAnimation : public BaseAnimGroup{
Q_OBJECT
+private:
+ QWidget *ball;
+
public:
SampleAnimation(QWidget *parent, QSettings *set) : BaseAnimGroup(parent, set){}
-
~SampleAnimation(){}
-private:
- QWidget *ball;
- virtual void LoadAnimations(){
+ void LoadAnimations(){
+ qDebug() << "Loading Sample Animation";
ball = new QWidget(canvas);
//This creates a red "ball" on the widget which is going to expand/contract in the center of the screen
ball->setStyleSheet("background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.341, fy:0.796, stop:0.00531915 rgba(107, 10, 10, 255), stop:0.521277 rgba(170, 10, 10, 255), stop:0.957447 rgba(200, 0, 0, 255), stop:0.994681 rgba(0, 0, 0, 225), stop:1 rgba(255, 255, 255, 0));");
- //ball->setSize(QSize(64,64));
- ball->move(canvas->geometry().center()-QPoint(32,32));
//Now setup the movements
- QPropertyAnimation *move = new QPropertyAnimation(ball,"size");
- move->setKeyValueAt(0, QSize(64, 64) );
+ QPropertyAnimation *move = new QPropertyAnimation(ball,"geometry");
+ QPoint ctr(canvas->width()/2, canvas->height()/2);
+ QRect initgeom(ctr-QPoint(12,12), QSize(24,24) );
+ move->setKeyValueAt(0, initgeom ); //starting point
+ move->setKeyValueAt(1, initgeom ); //ending point (same as start for continuity)
int size = canvas->width();
if(size > canvas->height()){ size = canvas->height(); }
- move->setKeyValueAt(0.5, QSize(size,size)); //touch the edge of the screen
- move->setKeyValueAt(1, QSize(64, 64) ); //back to original size
+ move->setKeyValueAt(0.5, QRect(ctr-QPoint(size/2, size/2), QSize(size,size))); //touch the edge of the screen
move->setDuration(10000); //10 seconds
this->addAnimation(move);
this->setLoopCount(10); //repeat 10 times
+ ball->show();
}
};
diff --git a/lumina-wm-INCOMPLETE/main.cpp b/lumina-wm-INCOMPLETE/main.cpp
index 683bbb24..53079a2f 100644
--- a/lumina-wm-INCOMPLETE/main.cpp
+++ b/lumina-wm-INCOMPLETE/main.cpp
@@ -28,7 +28,7 @@ int main(int argc, char ** argv)
QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
//Setup the global structures
LWM::SYSTEM = new LXCB();
- if(argc>1 && QString::fromLocal8Bit(argv[1])=="testwin"){
+ if( a.inputlist.contains("--test-win") ){
//Simple override to test out the window class
qDebug() << "Starting window test...";
QLabel dlg(0, Qt::Window | Qt::BypassWindowManagerHint); //this test should be ignored by the current WM
@@ -36,8 +36,9 @@ int main(int argc, char ** argv)
dlg.setWindowTitle("Test");
dlg.resize(200,100);
dlg.setStyleSheet("background: rgba(255,255,255,100); color: black;");
- dlg.show();
dlg.move(100,100);
+ dlg.show();
+ //dlg.move(100,100);
qDebug() << " - Loading window frame...";
LWindow win(dlg.winId()); //have it wrap around the dialog
qDebug() << " - Show frame...";
@@ -47,7 +48,7 @@ int main(int argc, char ** argv)
return a.exec();
}
WMSession w;
- w.start();
+ w.start(a.inputlist.contains("--test-ss"));
QObject::connect(&themes, SIGNAL(updateIcons()), &w, SLOT(reloadIcons()) );
QObject::connect(&a, SIGNAL(InputsAvailable(QStringList)), &w, SLOT(newInputsAvailable(QStringList)) );
int retCode = a.exec();
bgstack15