mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Revert "Add workaround for duplicate size changed events on Wayland"
Skipping size changed events can cause EGLRenderer to get stuck in
a state where it can't reset itself properly. This seems to happen
consistently when starting a maximized stream then transitioning
to full-screen.
This reverts commit e1b3f90f8b.
This commit is contained in:
@@ -1395,7 +1395,6 @@ void Session::execInternal()
|
|||||||
|
|
||||||
bool needsFirstEnterCapture = false;
|
bool needsFirstEnterCapture = false;
|
||||||
bool needsPostDecoderCreationCapture = false;
|
bool needsPostDecoderCreationCapture = false;
|
||||||
bool ignoreDuplicateResizes = false;
|
|
||||||
|
|
||||||
// HACK: For Wayland, we wait until we get the first SDL_WINDOWEVENT_ENTER
|
// HACK: For Wayland, we wait until we get the first SDL_WINDOWEVENT_ENTER
|
||||||
// event where it seems to work consistently on GNOME. For other platforms,
|
// event where it seems to work consistently on GNOME. For other platforms,
|
||||||
@@ -1404,13 +1403,6 @@ void Session::execInternal()
|
|||||||
if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
|
if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
|
||||||
// Native Wayland: Capture on SDL_WINDOWEVENT_ENTER
|
// Native Wayland: Capture on SDL_WINDOWEVENT_ENTER
|
||||||
needsFirstEnterCapture = true;
|
needsFirstEnterCapture = true;
|
||||||
|
|
||||||
// As of SDL 2.0.20, we get duplicate SDL_WINDOWEVENT_SIZE_CHANGED events
|
|
||||||
// when focus is lost and gained under GNOME Wayland. This causes us to
|
|
||||||
// recreate our renderer needlessly. This is fixed in SDL 2.0.21.
|
|
||||||
#if !SDL_VERSION_ATLEAST(2, 0, 21)
|
|
||||||
ignoreDuplicateResizes = true;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// X11/XWayland: Capture after decoder creation
|
// X11/XWayland: Capture after decoder creation
|
||||||
@@ -1448,7 +1440,6 @@ void Session::execInternal()
|
|||||||
// Hijack this thread to be the SDL main thread. We have to do this
|
// Hijack this thread to be the SDL main thread. We have to do this
|
||||||
// because we want to suspend all Qt processing until the stream is over.
|
// because we want to suspend all Qt processing until the stream is over.
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
Sint32 lastResizeW = -1, lastResizeH = -1;
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 18) && !defined(STEAM_LINK)
|
#if SDL_VERSION_ATLEAST(2, 0, 18) && !defined(STEAM_LINK)
|
||||||
// SDL 2.0.18 has a proper wait event implementation that uses platform
|
// SDL 2.0.18 has a proper wait event implementation that uses platform
|
||||||
@@ -1572,19 +1563,6 @@ void Session::execInternal()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
|
|
||||||
if (ignoreDuplicateResizes && lastResizeW == event.window.data1 && lastResizeH == event.window.data2) {
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
"Dropping duplicate size changed event: %d %d",
|
|
||||||
event.window.data1,
|
|
||||||
event.window.data2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
lastResizeW = event.window.data1;
|
|
||||||
lastResizeH = event.window.data2;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Recreating renderer for window event: %d (%d %d)",
|
"Recreating renderer for window event: %d (%d %d)",
|
||||||
event.window.event,
|
event.window.event,
|
||||||
|
|||||||
Reference in New Issue
Block a user