aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/RootWindow.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-26 15:09:22 -0500
committerKen Moore <ken@ixsystems.com>2017-01-26 15:09:22 -0500
commita74bf353f08f45f8f5fb91573d67ad463a25ad4d (patch)
treeba9a0f906666d7e593740bebe9776e2c03407e86 /src-qt5/core/libLumina/RootWindow.cpp
parentFinish up the new RootWindow class, and tie it into the lumina-desktop-unifie... (diff)
downloadlumina-a74bf353f08f45f8f5fb91573d67ad463a25ad4d.tar.gz
lumina-a74bf353f08f45f8f5fb91573d67ad463a25ad4d.tar.bz2
lumina-a74bf353f08f45f8f5fb91573d67ad463a25ad4d.zip
Another large batch of work on the new unified desktop.
1) Get the RootWindow up and functional. 2) Get the lumina-desktop-unified binary functional for starting to test the various pieces (not ready yet for general use) 3) Get the start-lumina-desktop binary setup to launch the new unified binary for testing if the "--unified" flag is used.
Diffstat (limited to 'src-qt5/core/libLumina/RootWindow.cpp')
-rw-r--r--src-qt5/core/libLumina/RootWindow.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/RootWindow.cpp b/src-qt5/core/libLumina/RootWindow.cpp
index 0121c3b2..aa5957b5 100644
--- a/src-qt5/core/libLumina/RootWindow.cpp
+++ b/src-qt5/core/libLumina/RootWindow.cpp
@@ -8,9 +8,11 @@
#include <QDesktopWidget>
#include <QScreen>
+#include <QDebug>
// === PUBLIC ===
-RootWindow::RootWindow(){
+RootWindow::RootWindow() : QWidget(0, Qt::Window | Qt::BypassWindowManagerHint | Qt::WindowStaysOnBottomHint){
+ qRegisterMetaType<WId>("WId");
autoResizeTimer = 0;
}
@@ -19,6 +21,7 @@ RootWindow::~RootWindow(){
}
void RootWindow::start(){
+
if(autoResizeTimer==0){
autoResizeTimer = new QTimer(this);
autoResizeTimer->setInterval(100); //1/10 second (collect all nearly-simultaneous signals and compress into a single update)
@@ -27,7 +30,9 @@ void RootWindow::start(){
connect(QApplication::desktop(), SIGNAL(resized(int)), autoResizeTimer, SLOT(start()) );
connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), autoResizeTimer, SLOT(start()) );
}
-
+ this->show();
+ ResizeRoot();
+ emit RegisterVirtualRoot(this->winId());
}
// === PRIVATE ===
@@ -123,6 +128,7 @@ void RootWindow::ResizeRoot(){
}
}
//Trigger a repaint and send out any signals
+ this->setGeometry(fullscreen);
this->update();
emit RootResized();
if(!valid.isEmpty()){ emit NewScreens(valid); }
@@ -136,6 +142,7 @@ void RootWindow::ChangeWallpaper(QString id, RootWindow::ScaleType scale, QStrin
WALLPAPERS[i].scale = scale;
WALLPAPERS[i].file = file;
updateScreenPixmap(&WALLPAPERS[i]);
+ //qDebug() << " --- Updated Wallpaper:" << WALLPAPERS[i].id << WALLPAPERS[i].file << WALLPAPERS[i].area;
found = true;
}
}
@@ -150,6 +157,7 @@ void RootWindow::ChangeWallpaper(QString id, RootWindow::ScaleType scale, QStrin
info.scale = scale;
info.area = scrns[i]->geometry();
updateScreenPixmap(&info);
+ //qDebug() << " --- Loaded Wallpaper:" << info.id << info.file << info.area;
WALLPAPERS << info;
break;
}
@@ -162,6 +170,7 @@ void RootWindow::ChangeWallpaper(QString id, RootWindow::ScaleType scale, QStrin
// === PROTECTED ===
void RootWindow::paintEvent(QPaintEvent *ev){
+ //qDebug() << "RootWindow: PaintEvent:" << ev->rect(); //<< QDateTime::currentDateTime()->toString(QDateTime::ShortDate);
bool found = false;
QPainter painter(this);
for(int i=0; i<WALLPAPERS.length(); i++){
bgstack15