From: Benjamin Otte Date: Thu, 13 Apr 2023 02:30:24 +0000 (+0200) Subject: wayland: Keep EGL window around when hidden X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~410^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=75bea01a86a4fb82c29636e8e86f4e30c551a65a;p=gtk4.git wayland: Keep EGL window around when hidden See previous commit: We want to keep resources around as long as the surface exists. --- diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 7e970f4a73..36aac757b0 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -817,6 +817,12 @@ gdk_wayland_surface_create_wl_surface (GdkSurface *surface) static void gdk_wayland_surface_destroy_wl_surface (GdkWaylandSurface *self) { + if (self->display_server.egl_window) + { + gdk_surface_set_egl_native_window (GDK_SURFACE (self), NULL); + g_clear_pointer (&self->display_server.egl_window, wl_egl_window_destroy); + } + g_clear_pointer (&self->display_server.viewport, wp_viewport_destroy); g_clear_pointer (&self->display_server.fractional_scale, wp_fractional_scale_v1_destroy); @@ -1053,13 +1059,6 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface) unmap_popups_for_surface (surface); - if (impl->display_server.egl_window) - { - gdk_surface_set_egl_native_window (surface, NULL); - wl_egl_window_destroy (impl->display_server.egl_window); - impl->display_server.egl_window = NULL; - } - impl->awaiting_frame = FALSE; if (impl->awaiting_frame_frozen) {