Qt: Fix Wayland support
Qt will only create a Wayland surface when show() is called on the main window and on the ScreenWidget. Thus, call the function before creating the GL context. Doesn't cause regressions on XWayland, untested in other platforms. Fixes #586
This commit is contained in:
@@ -22,6 +22,7 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent)
|
||||
// Enable drop events for loading ROMs
|
||||
setAcceptDrops(true);
|
||||
resize(800, 240 * 4);
|
||||
show();
|
||||
|
||||
// We pass a callback to the screen widget that will be triggered every time we resize the screen
|
||||
screen = new ScreenWidget([this](u32 width, u32 height) { handleScreenResize(width, height); }, this);
|
||||
@@ -699,4 +700,4 @@ void MainWindow::setupControllerSensors(SDL_GameController* controller) {
|
||||
if (haveAccelerometer) {
|
||||
SDL_GameControllerSetSensorEnabled(controller, SDL_SENSOR_ACCEL, SDL_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user