diff options
-rw-r--r-- | src-qt5/core/libLumina/NativeEmbedWidget.cpp | 20 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeEmbedWidget.h | 2 | ||||
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.cpp | 20 |
3 files changed, 34 insertions, 8 deletions
diff --git a/src-qt5/core/libLumina/NativeEmbedWidget.cpp b/src-qt5/core/libLumina/NativeEmbedWidget.cpp index 2f3691ae..b998c4b5 100644 --- a/src-qt5/core/libLumina/NativeEmbedWidget.cpp +++ b/src-qt5/core/libLumina/NativeEmbedWidget.cpp @@ -155,6 +155,26 @@ bool NativeEmbedWidget::isEmbedded(){ } // ============== +// PUBLIC SLOTS +// ============== +void NativeEmbedWidget::resyncWindow(){ + QSize sz = this->size(); + if(WIN==0){ return; } + //qDebug() << "Sync Window Size:" << sz; + xcb_configure_window_value_list_t valList; + valList.x = -1; + valList.y = 0; + valList.width = sz.width(); + valList.height = sz.height(); + uint16_t mask = 0; + mask = mask | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; + mask = mask | XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; + xcb_configure_window_aux(QX11Info::connection(), WIN->id(), mask, &valList); + valList.x = 0; + xcb_configure_window_aux(QX11Info::connection(), WIN->id(), mask, &valList); +} + +// ============== // PROTECTED // ============== void NativeEmbedWidget::resizeEvent(QResizeEvent *ev){ diff --git a/src-qt5/core/libLumina/NativeEmbedWidget.h b/src-qt5/core/libLumina/NativeEmbedWidget.h index 55d655f2..07e1c4dd 100644 --- a/src-qt5/core/libLumina/NativeEmbedWidget.h +++ b/src-qt5/core/libLumina/NativeEmbedWidget.h @@ -38,7 +38,7 @@ public: bool isEmbedded(); //status of the embed public slots: - void resyncWindow(){ syncWinSize(this->size()); } + void resyncWindow(); protected: void resizeEvent(QResizeEvent *ev); 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; |