From f53a08403b0367fdce6ca2a64554acec370ca3fa Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sat, 20 Jun 2015 11:02:27 -0400 Subject: Adjust the new window adjustment routine a bit - make it use the center of the window to calculate which screen it is on instead of the upper-left corner. --- lumina-desktop/LSession.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 29e1d237..040c27de 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -483,7 +483,7 @@ void LSession::adjustWindowGeom(WId win, bool maximize){ //Get the available geometry for the screen the window is on QRect desk; for(int i=0; idesktop()->screenGeometry(DESKTOPS[i]->Screen()).contains(geom.topLeft()) ){ + if( this->desktop()->screenGeometry(DESKTOPS[i]->Screen()).contains(geom.center()) ){ //Window is on this screen if(DEBUG){ qDebug() << " - On Screen:" << DESKTOPS[i]->Screen(); } desk = DESKTOPS[i]->availableScreenGeom(); @@ -502,6 +502,8 @@ void LSession::adjustWindowGeom(WId win, bool maximize){ qDebug() << " - Desk:" << desk.x() << desk.y() << desk.width() << desk.height(); qDebug() << " - Geom:" << geom.x() << geom.y() << geom.width() << geom.height(); } + QList frame = XCB->WindowFrameGeometry(win); + if(DEBUG){ qDebug() << " - Frame:" << frame; } //Adjust origin point for left/top margins if(geom.y() < desk.y()){ geom.moveTop(desk.y()); } //move down to the edge (top panel) if(geom.x() < desk.x()){ geom.moveLeft(desk.x()); } //move right to the edge (left panel) -- cgit