diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index b08ea375c..b72553810 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -669,6 +669,8 @@ void GLArea::paintEvent(QPaintEvent* /*event*/) glFlush(); glFinish(); painter.endNativePainting(); + + emit currentViewerRefreshed(); } void GLArea::displayMatrix(QPainter *painter, QRect areaRect) diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index 26326a3fc..8b4cab0ad 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -279,6 +279,7 @@ signals: void glareaClosed(); //someone has closed the glarea void insertRenderingDataForNewlyGeneratedMesh(int); void currentViewerChanged(int currentId); + void currentViewerRefreshed(); public slots: diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index f0f8d07d4..cc0ea6e75 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -475,8 +475,13 @@ void MainWindow::setUnsplit() assert(mvc->viewerCounter() >1); mvc->removeView(mvc->currentView()->getId()); - - updateMenus(); + + // After the view is removed and the remaining viewers + // are refreshed to fill the freed area, the geometry + // of these viewers becomes known, and then the menus + // can be updated correctly. + QObject::connect(mvc->currentView(), SIGNAL(currentViewerRefreshed()), + this, SLOT(updateMenus())); } }