Qt: Fix race condition when switching to fullscreen

Stops the window opening in the corner of the screen occasionally in Wayland.
This commit is contained in:
Connor McLaughlin
2021-07-17 22:58:31 +10:00
parent d6c4c2dda9
commit d519ba3d59
3 changed files with 5 additions and 3 deletions

View File

@ -160,6 +160,8 @@ QtDisplayWidget* MainWindow::createDisplay(QThread* worker_thread, bool fullscre
// we need the surface visible.. this might be able to be replaced with something else
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
m_host_interface->connectDisplaySignals(m_display_widget);
std::optional<WindowInfo> wi = m_display_widget->getWindowInfo();
if (!wi.has_value())
{
@ -262,6 +264,8 @@ QtDisplayWidget* MainWindow::updateDisplay(QThread* worker_thread, bool fullscre
// we need the surface visible.. this might be able to be replaced with something else
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
m_host_interface->connectDisplaySignals(m_display_widget);
std::optional<WindowInfo> wi = m_display_widget->getWindowInfo();
if (!wi.has_value())
{