From 334bb3d2ebb26ea518c0f2c98490d79d6b3e77ef Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 20 Jul 2017 17:17:54 -0400 Subject: Get the compositing and window interactions all cleaned up. Seems to work great now. --- src-qt5/core/libLumina/RootWindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src-qt5/core/libLumina/RootWindow.cpp') diff --git a/src-qt5/core/libLumina/RootWindow.cpp b/src-qt5/core/libLumina/RootWindow.cpp index 31faaf50..fda9ca0f 100644 --- a/src-qt5/core/libLumina/RootWindow.cpp +++ b/src-qt5/core/libLumina/RootWindow.cpp @@ -169,7 +169,7 @@ void RootWindow::ChangeWallpaper(QString id, RootWindow::ScaleType scale, QStrin void RootWindow::NewWindow(NativeWindow *win){ RootSubWindow *subwin = 0; - qDebug() << "Got New Window:" << win->property(NativeWindow::Title); + //qDebug() << "Got New Window:" << win->property(NativeWindow::Title); for(int i=0; iid() == win->id()){ subwin = WINDOWS[i]; } } @@ -185,7 +185,7 @@ void RootWindow::NewWindow(NativeWindow *win){ void RootWindow::CloseWindow(WId win){ for(int i=0; iid() == win){ qDebug() << "Remove Window From Root List"; WINDOWS.takeAt(i)->clientClosed(); break; } + if(WINDOWS[i]->id() == win){ WINDOWS.takeAt(i)->clientClosed(); break; } } } @@ -196,10 +196,12 @@ void RootWindow::paintEvent(QPaintEvent *ev){ //qDebug() << "RootWindow: PaintEvent:" << ev->rect(); //<< QDateTime::currentDateTime()->toString(QDateTime::ShortDate); bool found = false; QPainter painter(this); + QRect geom = ev->rect(); + geom.adjust(-10,-10,10,10); //give it a few more pixels in each direction to repaint (noticing some issues in Qt 5.7.1) for(int i=0; irect()) ){ + if(WALLPAPERS[i].area.intersects(geom) ){ found = true; - QRect intersect = WALLPAPERS[i].area.intersected(ev->rect()); + QRect intersect = WALLPAPERS[i].area.intersected(geom); painter.drawPixmap( intersect, WALLPAPERS[i].wallpaper, intersect.translated(-WALLPAPERS[i].area.x(), -WALLPAPERS[i].area.y()) ); } } -- cgit From 8d228ded7c6450e241f3550298bb34258384bf70 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 21 Jul 2017 09:39:33 -0400 Subject: Fix up some multi-monitor issues with Lumina2 (Qt auto-scaling is a really bad idea) --- src-qt5/core/libLumina/RootWindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src-qt5/core/libLumina/RootWindow.cpp') diff --git a/src-qt5/core/libLumina/RootWindow.cpp b/src-qt5/core/libLumina/RootWindow.cpp index fda9ca0f..90ad8739 100644 --- a/src-qt5/core/libLumina/RootWindow.cpp +++ b/src-qt5/core/libLumina/RootWindow.cpp @@ -10,6 +10,8 @@ #include #include +#define DEBUG 1 + // === PUBLIC === RootWindow::RootWindow() : QWidget(0, Qt::Window | Qt::BypassWindowManagerHint | Qt::WindowStaysOnBottomHint){ qRegisterMetaType("WId"); @@ -100,12 +102,14 @@ void RootWindow::updateScreenPixmap(screeninfo *info){ // === PUBLIC SLOTS === void RootWindow::ResizeRoot(){ + if(DEBUG){ qDebug() << "Resize Root..."; } QList scrns = QApplication::screens(); //Update all the screen locations and ID's in the WALLPAPERS list QRect fullscreen; QStringList valid; //Update the size of the rootWindow itself for(int i=0; iname() << scrns[i]->geometry(); } fullscreen = fullscreen.united(scrns[i]->geometry()); valid << scrns[i]->name(); for(int j=0; jsetGeometry(fullscreen); this->update(); emit RootResized(fullscreen); if(!valid.isEmpty()){ emit NewScreens(valid); } if(!invalid.isEmpty()){ emit RemovedScreens(invalid); } + if(DEBUG){ qDebug() << " - Geom after change:" << this->geometry(); } } void RootWindow::ChangeWallpaper(QString id, RootWindow::ScaleType scale, QString file){ @@ -148,6 +154,7 @@ void RootWindow::ChangeWallpaper(QString id, RootWindow::ScaleType scale, QStrin } } if(!found){ + ResizeRoot(); //Need to create a new screeninfo structure QList scrns = QApplication::screens(); for(int i=0; i