start actually implementing multi-window feature, still rough around the edges

fix crash when closing main window if sub windows are involved

fix OpenGL context handling, still need to fix when changing display type
This commit is contained in:
Arisotura
2024-10-27 01:14:29 +02:00
parent f375099613
commit 881a740cab
8 changed files with 49 additions and 33 deletions

View File

@ -588,6 +588,13 @@ MainWindow::MainWindow(int id, EmuInstance* inst, QWidget* parent) :
}
}
menu->addSeparator();
actNewWindow = menu->addAction("Open new window");
connect(actNewWindow, &QAction::triggered, this, &MainWindow::onOpenNewWindow);
menu->addSeparator();
actScreenFiltering = menu->addAction("Screen filtering");
actScreenFiltering->setCheckable(true);
connect(actScreenFiltering, &QAction::triggered, this, &MainWindow::onChangeScreenFiltering);
@ -1950,6 +1957,11 @@ void MainWindow::onChangeIntegerScaling(bool checked)
emit screenLayoutChange();
}
void MainWindow::onOpenNewWindow()
{
emuInstance->createWindow();
}
void MainWindow::onChangeScreenFiltering(bool checked)
{
windowCfg.SetBool("ScreenFilter", checked);
@ -2077,7 +2089,7 @@ void MainWindow::onUpdateVideoSettings(bool glchange)
if (glchange)
{
emuThread->emuPause();
if (hasOGL) emuThread->deinitContext();
if (hasOGL) emuThread->deinitContext(windowID);
delete panel;
createScreenPanel();
@ -2088,7 +2100,7 @@ void MainWindow::onUpdateVideoSettings(bool glchange)
if (glchange)
{
if (hasOGL) emuThread->initContext();
if (hasOGL) emuThread->initContext(windowID);
emuThread->emuUnpause();
}
}