wayland: Fix mapping borderless windows under libdecor

Additionally, add a warning about calling the frame visibility function universally during the mapping process, as the libdecor Cairo plugin has a bug that will cause a crash in this scenario.
This commit is contained in:
Frank Praznik 2025-02-23 11:04:29 -05:00
parent 1a0a94b501
commit 52af81ea17
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -1864,6 +1864,10 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
} else {
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, data->app_id);
libdecor_frame_map(data->shell_surface.libdecor.frame);
if (window->flags & SDL_WINDOW_BORDERLESS) {
// Note: Calling this with 'true' immediately after mapping will cause the libdecor Cairo plugin to crash.
libdecor_frame_set_visibility(data->shell_surface.libdecor.frame, false);
}
if (c->zxdg_exporter_v2) {
data->exported = zxdg_exporter_v2_export_toplevel(c->zxdg_exporter_v2, data->surface);