diff options
author | Ken Moore <ken@ixsystems.com> | 2017-07-18 20:47:10 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-07-18 20:47:10 -0400 |
commit | 1de88d56aa6eafc7ee347a607ae855526e5edad5 (patch) | |
tree | 475d3c380593b7793e764787a83ebac182de0fa3 /src-qt5/core/libLumina/RootSubWindow.cpp | |
parent | Clean up a bit of debugging and such (diff) | |
download | lumina-1de88d56aa6eafc7ee347a607ae855526e5edad5.tar.gz lumina-1de88d56aa6eafc7ee347a607ae855526e5edad5.tar.bz2 lumina-1de88d56aa6eafc7ee347a607ae855526e5edad5.zip |
Finish up the on-move window notification so that sub-windows (menus and such) are painted in the proper place.
Diffstat (limited to 'src-qt5/core/libLumina/RootSubWindow.cpp')
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp index 35b2d7cd..1059871a 100644 --- a/src-qt5/core/libLumina/RootSubWindow.cpp +++ b/src-qt5/core/libLumina/RootSubWindow.cpp @@ -27,6 +27,7 @@ RootSubWindow::RootSubWindow(QWidget *root, NativeWindow *win) : QFrame(root){ connect(WIN, SIGNAL(PropertiesChanged(QList<NativeWindow::Property>, QList<QVariant>)), this, SLOT(propertiesChanged(QList<NativeWindow::Property>, QList<QVariant>))); WinWidget->embedWindow(WIN); //qDebug() << "[NEW WINDOW]" << WIN->id() << WinWidget->winId() << this->winId(); + activeState = RootSubWindow::Normal; LoadAllProperties(); } @@ -96,6 +97,7 @@ RootSubWindow::ModState RootSubWindow::getStateAtPoint(QPoint pt, bool setoffset return Normal; } } + //if it gets this far just return normal return Normal; } @@ -305,7 +307,8 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList case NativeWindow::Visible: //qDebug() << "Got Visibility Change:" << vals[i] << this->geometry() << WIN->geometry(); if(vals[i].toBool()){ - animResetProp = WIN->geometry(); //this->geometry(); + if(lastGeom.isNull()){ animResetProp = this->geometry(); } + else{ animResetProp = lastGeom; } anim->setPropertyName("geometry"); anim->setStartValue( QRect(animResetProp.toRect().center(), QSize(0,0)) ); anim->setEndValue(animResetProp); @@ -314,6 +317,7 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList this->show(); }else{ animResetProp = this->geometry(); //hide event - should already be the right geom + lastGeom = this->geometry(); anim->setPropertyName("geometry"); anim->setStartValue(this->geometry()); anim->setEndValue( QRect(this->geometry().center(), QSize(0,0) ) ); @@ -331,21 +335,23 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList break; case NativeWindow::GlobalPos: //qDebug() << "Got Global Pos:" << this->pos() << WinWidget->mapToGlobal(QPoint(0,0)) << WIN->geometry().topLeft() << vals[i].toPoint(); - this->move( vals[i].toPoint() - (WinWidget->mapToGlobal(QPoint(0,0)) - this->pos()) ); //WIN->geometry().topLeft() ); + if(activeState == RootSubWindow::Normal){ + this->move( WIN->geometry().topLeft() ); + } break; case NativeWindow::Size: - qDebug() << " - SIZE CHANGE"; + //qDebug() << " - SIZE CHANGE"; if(WIN->property(NativeWindow::FrameExtents).isNull() && (i<props.indexOf(NativeWindow::FrameExtents)) ){ //Frame not loaded yet - push this back until after the frame is set props << props.takeAt(i); vals << vals.takeAt(i); i--; - }else if(anim->state() != QPropertyAnimation::Running){ - if(vals[i].toSize() != WinWidget->size()){ - qDebug() << "Got Widget Size Change:" << vals[i].toSize() << WinWidget->size(); + }else if(anim->state() != QPropertyAnimation::Running ){ + if(vals[i].toSize() != WinWidget->size() && activeState==Normal){ + //qDebug() << "Got Widget Size Change:" << vals[i].toSize() << WinWidget->size(); WinWidget->resize(vals[i].toSize()); this->resize( WIN->geometry().size() ); - qDebug() << " - Size after change:" << WinWidget->size() << this->size() << WIN->geometry(); + //qDebug() << " - Size after change:" << WinWidget->size() << this->size() << WIN->geometry(); } } break; |