Qt: Work around popups opened behind window in Wayland

This commit is contained in:
Connor McLaughlin 2022-11-23 20:14:31 +10:00
parent 373297f35b
commit 2610bb11cd
1 changed files with 9 additions and 0 deletions

View File

@ -2747,8 +2747,17 @@ MainWindow::SystemLock MainWindow::pauseAndLockSystem()
if (was_fullscreen)
g_emu_thread->setSurfaceless(true);
if (!was_paused)
{
g_emu_thread->setSystemPaused(true);
// Need to wait for the pause to go through, and make the main window visible if needed.
while (!s_system_paused)
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 1);
// Ensure it's visible before we try to create any dialogs parented to us.
QApplication::sync();
}
// We want to parent dialogs to the display widget, except if we were fullscreen,
// since it's going to get destroyed by the surfaceless call above.
QWidget* dialog_parent = was_fullscreen ? static_cast<QWidget*>(this) : getDisplayContainer();