From 06795b00ad7a51f13c5cc9393157680b7c7f186e Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Wed, 17 Jun 2026 19:06:14 -0400
Subject: [PATCH] wayland: Attach EGL objects to custom and external surfaces
during reconfiguration
They are required when using EGL with an external surface.
---
src/video/SDL_video.c | 5 -----
src/video/wayland/SDL_waylandwindow.c | 4 +++-
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 2d9a59adf8b11..57bb945942837 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2666,11 +2666,6 @@ static bool SDL_ReconfigureWindowInternal(SDL_Window *window, SDL_WindowFlags fl
return false;
}
- // Don't attempt to reconfigure external windows.
- if (window->flags & SDL_WINDOW_EXTERNAL) {
- return false;
- }
-
// Only attempt to reconfigure if the window has no existing graphics flags.
if (window->flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN)) {
return false;
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 8cd36259a9ca5..b6595c7a0713c 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -2863,7 +2863,9 @@ bool Wayland_ReconfigureWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_W
{
SDL_WindowData *data = window->internal;
- if (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_SHOWN) {
+ // Don't try to reconfigure mapped windows, unless they are custom or external.
+ if (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_SHOWN &&
+ data->shell_surface_type != WAYLAND_SHELL_SURFACE_TYPE_CUSTOM) {
// Window is already mapped; abort.
return false;
}