aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-04-26 17:48:37 -0400
committerKen Moore <ken@ixsystems.com>2018-04-26 17:50:10 -0400
commitf228077850b16fdd92310782aafe3f7f2b437adb (patch)
treeaa622a0787d40597cf251f6af75381be13349405 /src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp
parentFix up the loading of *.desktop icons via LFileInfo (diff)
downloadlumina-f228077850b16fdd92310782aafe3f7f2b437adb.tar.gz
lumina-f228077850b16fdd92310782aafe3f7f2b437adb.tar.bz2
lumina-f228077850b16fdd92310782aafe3f7f2b437adb.zip
Commit a bunch more work on the Lumina 2 screen reservations.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp
index c9dd97f8..45aa1101 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/NativeWindowObject.cpp
@@ -268,10 +268,11 @@ void NativeWindowObject::updateGeometry(int x, int y, int width, int height, boo
QPoint pos(x+fgeom[0], y+fgeom[2]);
QSize sz(width-fgeom[0]-fgeom[1], height-fgeom[2]-fgeom[3]);
newgeom = QRect(pos, sz);
+ lastgeom = QRect(x,y,width,height); //save this for later
if(!now){
//qDebug() << "Update Geometry:" << fgeom << QRect(x,y,width,height) << pos << sz;
//requestProperties(QList<NativeWindowObject::Property>() << NativeWindowObject::GlobalPos << NativeWindowObject::Size, QList<QVariant>() << pos << sz);
- if(!geomTimer->isActive()){ geomTimer->start(); }
+ if(!geomTimer->isActive()){ QTimer::singleShot(0,geomTimer, SLOT(start())); }
}else{
sendNewGeom();
}
@@ -295,18 +296,23 @@ void NativeWindowObject::toggleMaximize(){
}
}
//Now compare the current geometry to the screen geometry
+ qDebug() << "Maximize Toggle:" << curgeom << max;
if(curgeom!=max){
+ qDebug() << " - maximize";
setGeometryNow(max); //will set newgeom to max
- newgeom = curgeom; //now reset newgeom
+ lastgeom = curgeom; //save this for later
}else{
+ qDebug() << " - restore" << lastgeom;
//Already maximized, look at the old geometry and figure out how to restore it
- if(newgeom.isNull()){
+ if(lastgeom.isNull() || lastgeom == max){
+ qDebug() << " -- Reset lastgeom to half-screen size";
//no old info available - center the window at half maximum size
- newgeom = QRect(max.x()-max.width()/2, max.y()-max.height()/2, max.width()/2, max.height()/2);
+ lastgeom = QRect(max.x()-max.width()/2, max.y()-max.height()/2, max.width()/2, max.height()/2);
}
- setGeometryNow(newgeom);
+ setGeometryNow(lastgeom);
}
- emit geomChanged();
+ qDebug() << "After toggle:" << lastgeom;
+ //emit geomChanged();
}
void NativeWindowObject::requestClose(){
bgstack15