Skip to content

Commit ec0bc79

Browse files
committed
wayland: Set the libdecor frame visibility before mapping
Mapping the frame will commit the surface state, which will commit the subsurface tree and geometry. Map after setting the initial frame visibility to avoid setting geometry and subsurfaces, which may immediately change.
1 parent 221d1f1 commit ec0bc79

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/video/wayland/SDL_waylandwindow.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,11 +1892,8 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
18921892
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Failed to create libdecor frame!");
18931893
} else {
18941894
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, data->app_id);
1895+
libdecor_frame_set_visibility(data->shell_surface.libdecor.frame, !(window->flags & SDL_WINDOW_BORDERLESS));
18951896
libdecor_frame_map(data->shell_surface.libdecor.frame);
1896-
if (window->flags & SDL_WINDOW_BORDERLESS) {
1897-
// Note: Calling this with 'true' immediately after mapping will cause the libdecor Cairo plugin to crash.
1898-
libdecor_frame_set_visibility(data->shell_surface.libdecor.frame, false);
1899-
}
19001897

19011898
if (c->zxdg_exporter_v2) {
19021899
data->exported = zxdg_exporter_v2_export_toplevel(c->zxdg_exporter_v2, data->surface);

0 commit comments

Comments
 (0)