Skip to content
Snippets Groups Projects
Commit b6604a7a authored by Ludwig Jaeck's avatar Ludwig Jaeck
Browse files

MainWindow: fix window redraw after new project

Canvas is not initialized in application start so a window manager like x11 may reopen the mainwindow on gl context switching without this fix.

The behaviour was caused by different surface format / opengl contexts of the QMainWindow instance and the QOpenGLWidget instance of Canvas. In Qt6 it became more complex to quickly share the gl context. Hence we just create a dummy QOpenGLWidget before MainWindow is show to reset it.
parent 02a1dbd8
No related branches found
No related tags found
1 merge request!1333MainWindow: Addend bandage fix to keep MainWindow open when the docked OpenGl...
Pipeline #89086 passed
......@@ -31,6 +31,7 @@
#include <QButtonGroup>
#include <QCloseEvent>
#include <QMessageBox>
#include <QOpenGLWidget>
#include <QProgressBar>
#include <QPushButton>
#include <QSettings>
......@@ -74,6 +75,8 @@ MainWindow::MainWindow()
vlayout->setSpacing(0);
vlayout->addLayout(m_viewsStack);
vlayout->addWidget(new QOpenGLWidget()); // quick fix to reset surface format
mainLayout->addLayout(m_viewSelectionButtonsLayout);
mainLayout->addLayout(vlayout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment