mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-28 00:25:43 +00:00
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:
parent
d6c4c2dda9
commit
d519ba3d59
|
@ -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
|
// we need the surface visible.. this might be able to be replaced with something else
|
||||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
|
m_host_interface->connectDisplaySignals(m_display_widget);
|
||||||
|
|
||||||
std::optional<WindowInfo> wi = m_display_widget->getWindowInfo();
|
std::optional<WindowInfo> wi = m_display_widget->getWindowInfo();
|
||||||
if (!wi.has_value())
|
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
|
// we need the surface visible.. this might be able to be replaced with something else
|
||||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
|
m_host_interface->connectDisplaySignals(m_display_widget);
|
||||||
|
|
||||||
std::optional<WindowInfo> wi = m_display_widget->getWindowInfo();
|
std::optional<WindowInfo> wi = m_display_widget->getWindowInfo();
|
||||||
if (!wi.has_value())
|
if (!wi.has_value())
|
||||||
{
|
{
|
||||||
|
|
|
@ -578,7 +578,6 @@ bool QtHostInterface::AcquireHostDisplay()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
connectDisplaySignals(display_widget);
|
|
||||||
m_is_exclusive_fullscreen = m_display->IsFullscreen();
|
m_is_exclusive_fullscreen = m_display->IsFullscreen();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -641,7 +640,6 @@ void QtHostInterface::updateDisplayState()
|
||||||
if (!display_widget || !m_display->MakeRenderContextCurrent())
|
if (!display_widget || !m_display->MakeRenderContextCurrent())
|
||||||
Panic("Failed to make device context current after updating");
|
Panic("Failed to make device context current after updating");
|
||||||
|
|
||||||
connectDisplaySignals(display_widget);
|
|
||||||
m_is_exclusive_fullscreen = m_display->IsFullscreen();
|
m_is_exclusive_fullscreen = m_display->IsFullscreen();
|
||||||
|
|
||||||
OnHostDisplayResized();
|
OnHostDisplayResized();
|
||||||
|
|
|
@ -90,6 +90,7 @@ public:
|
||||||
ALWAYS_INLINE MainWindow* getMainWindow() const { return m_main_window; }
|
ALWAYS_INLINE MainWindow* getMainWindow() const { return m_main_window; }
|
||||||
void setMainWindow(MainWindow* window);
|
void setMainWindow(MainWindow* window);
|
||||||
HostDisplay* createHostDisplay();
|
HostDisplay* createHostDisplay();
|
||||||
|
void connectDisplaySignals(QtDisplayWidget* widget);
|
||||||
|
|
||||||
void populateLoadStateMenu(const char* game_code, QMenu* menu);
|
void populateLoadStateMenu(const char* game_code, QMenu* menu);
|
||||||
void populateSaveStateMenu(const char* game_code, QMenu* menu);
|
void populateSaveStateMenu(const char* game_code, QMenu* menu);
|
||||||
|
@ -269,7 +270,6 @@ private:
|
||||||
void shutdownOnThread();
|
void shutdownOnThread();
|
||||||
void installTranslator();
|
void installTranslator();
|
||||||
void renderDisplay();
|
void renderDisplay();
|
||||||
void connectDisplaySignals(QtDisplayWidget* widget);
|
|
||||||
void checkRenderToMainState();
|
void checkRenderToMainState();
|
||||||
void updateDisplayState();
|
void updateDisplayState();
|
||||||
void queueSettingsSave();
|
void queueSettingsSave();
|
||||||
|
|
Loading…
Reference in a new issue