From c1f67585e6443e8ae46edb49460aadd658f6cdaa Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 1 Aug 2025 10:33:55 -0400 Subject: [PATCH] wayland: Cleanup an outdated conditional and comment There may have been a reason for not attaching a null buffer when destroying a popup at some point in the past, but that is unnecessary now, as is the comment about ShowWindow crashing, as ShowWindow assures that a null buffer is attached before (re)creating the window. (cherry picked from commit 550d95e04f2a89e4f890e6bdeec6357e2074eb08) --- src/video/wayland/SDL_waylandwindow.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index d5d7c869a8..75d18bd32f 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -2153,11 +2153,9 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) } } - // Be sure to detach after this is done, otherwise ShowWindow crashes! - if (wind->shell_surface_type != WAYLAND_SHELL_SURFACE_TYPE_XDG_POPUP) { - wl_surface_attach(wind->surface, NULL, 0, 0); - wl_surface_commit(wind->surface); - } + // Attach a null buffer to unmap the surface. + wl_surface_attach(wind->surface, NULL, 0, 0); + wl_surface_commit(wind->surface); SDL_zero(wind->shell_surface); wind->show_hide_sync_required = true;