From ee5918cf4edbd0a7e6422887c21c9114321fa68f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 22 Jan 2022 12:29:44 -0600 Subject: [PATCH] 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 e1b3f90f8b5686f6373f94fdbf69664f168ff9c2. --- app/streaming/session.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 9d202cbb..8f64c2e6 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1395,7 +1395,6 @@ void Session::execInternal() bool needsFirstEnterCapture = false; bool needsPostDecoderCreationCapture = false; - bool ignoreDuplicateResizes = false; // 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, @@ -1404,13 +1403,6 @@ void Session::execInternal() if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { // Native Wayland: Capture on SDL_WINDOWEVENT_ENTER 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 { // 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 // because we want to suspend all Qt processing until the stream is over. SDL_Event event; - Sint32 lastResizeW = -1, lastResizeH = -1; for (;;) { #if SDL_VERSION_ATLEAST(2, 0, 18) && !defined(STEAM_LINK) // SDL 2.0.18 has a proper wait event implementation that uses platform @@ -1572,19 +1563,6 @@ void Session::execInternal() 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, "Recreating renderer for window event: %d (%d %d)", event.window.event,