Skip to content

Commit 9034375

Browse files
A1029384756Kontrabant
authored andcommitted
wayland: reorder surface destruction to avoid premature blanking
1 parent 83818ee commit 9034375

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/video/wayland/SDL_waylandwindow.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,12 +2127,6 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
21272127
wind->server_decoration = NULL;
21282128
}
21292129

2130-
// Be sure to detach after this is done, otherwise ShowWindow crashes!
2131-
if (wind->shell_surface_type != WAYLAND_SHELL_SURFACE_TYPE_XDG_POPUP) {
2132-
wl_surface_attach(wind->surface, NULL, 0, 0);
2133-
wl_surface_commit(wind->surface);
2134-
}
2135-
21362130
// Clean up the export handle.
21372131
if (wind->exported) {
21382132
zxdg_exported_v2_destroy(wind->exported);
@@ -2170,6 +2164,12 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
21702164
}
21712165
}
21722166

2167+
// Be sure to detach after this is done, otherwise ShowWindow crashes!
2168+
if (wind->shell_surface_type != WAYLAND_SHELL_SURFACE_TYPE_XDG_POPUP) {
2169+
wl_surface_attach(wind->surface, NULL, 0, 0);
2170+
wl_surface_commit(wind->surface);
2171+
}
2172+
21732173
SDL_zero(wind->shell_surface);
21742174
wind->show_hide_sync_required = true;
21752175
struct wl_callback *cb = wl_display_sync(_this->internal->display);

0 commit comments

Comments
 (0)