aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-06-20 11:02:27 -0400
committerKen Moore <ken@pcbsd.org>2015-06-20 11:02:27 -0400
commitf53a08403b0367fdce6ca2a64554acec370ca3fa (patch)
treeac686cac1b577da007bb99c60457ef3880fc8002
parentAdd a new function to luminaX11: WindowFrameGeometry() - returns the sizes of... (diff)
downloadlumina-f53a08403b0367fdce6ca2a64554acec370ca3fa.tar.gz
lumina-f53a08403b0367fdce6ca2a64554acec370ca3fa.tar.bz2
lumina-f53a08403b0367fdce6ca2a64554acec370ca3fa.zip
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.
-rw-r--r--lumina-desktop/LSession.cpp4
1 files changed, 3 insertions, 1 deletions
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; i<DESKTOPS.length(); i++){
- if( this->desktop()->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<int> 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)
bgstack15