mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-27 02:46:08 +08:00
wayland: reorder surface destruction to avoid premature blanking
(cherry picked from commit 9034375d2f)
This commit is contained in:
committed by
Frank Praznik
parent
edef6e66e9
commit
93988e28c0
@@ -2116,12 +2116,6 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|||||||
wind->server_decoration = NULL;
|
wind->server_decoration = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean up the export handle.
|
// Clean up the export handle.
|
||||||
if (wind->exported) {
|
if (wind->exported) {
|
||||||
zxdg_exported_v2_destroy(wind->exported);
|
zxdg_exported_v2_destroy(wind->exported);
|
||||||
@@ -2159,6 +2153,12 @@ 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);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_zero(wind->shell_surface);
|
SDL_zero(wind->shell_surface);
|
||||||
wind->show_hide_sync_required = true;
|
wind->show_hide_sync_required = true;
|
||||||
struct wl_callback *cb = wl_display_sync(_this->internal->display);
|
struct wl_callback *cb = wl_display_sync(_this->internal->display);
|
||||||
|
|||||||
Reference in New Issue
Block a user