summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-05-14 17:37:41 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-05-14 23:49:44 -0400
commit982a696311ed44add2b4a3c54f59a658928fea11 (patch)
tree0ab7e9fbfc684ba68a7a05feb9a04c4a2c682cb6
parente5f1e4545d22a75518c7be54e20ecdda19273c4e (diff)
downloadgtk+-982a696311ed44add2b4a3c54f59a658928fea11.tar.gz
wayland: Give toplevels a destroy hook
We will need to do some cleanup before the wl_surface is destroyed, so add a hook for that.
-rw-r--r--gdk/wayland/gdksurface-wayland.c5
-rw-r--r--gdk/wayland/gdktoplevel-wayland-private.h1
-rw-r--r--gdk/wayland/gdktoplevel-wayland.c5
3 files changed, 10 insertions, 1 deletions
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 5663a42d38..9d92737f83 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -1148,7 +1148,10 @@ gdk_wayland_surface_destroy (GdkSurface *surface,
gdk_wayland_surface_hide_surface (surface);
- gdk_wayland_surface_destroy_wl_surface (GDK_WAYLAND_SURFACE(surface));
+ if (GDK_IS_TOPLEVEL (surface))
+ gdk_wayland_toplevel_destroy (GDK_TOPLEVEL (surface));
+
+ gdk_wayland_surface_destroy_wl_surface (GDK_WAYLAND_SURFACE (surface));
frame_clock = gdk_surface_get_frame_clock (surface);
g_signal_handlers_disconnect_by_func (frame_clock, on_frame_clock_before_paint, surface);
diff --git a/gdk/wayland/gdktoplevel-wayland-private.h b/gdk/wayland/gdktoplevel-wayland-private.h
index 9b06101371..bd0836c0a0 100644
--- a/gdk/wayland/gdktoplevel-wayland-private.h
+++ b/gdk/wayland/gdktoplevel-wayland-private.h
@@ -39,3 +39,4 @@ void gdk_wayland_toplevel_announce_ssd (GdkToplevel *toplevel);
gboolean gdk_wayland_toplevel_inhibit_idle (GdkToplevel *toplevel);
void gdk_wayland_toplevel_uninhibit_idle (GdkToplevel *toplevel);
+void gdk_wayland_toplevel_destroy (GdkToplevel *toplevel);
diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c
index 7b968e5c16..459462485a 100644
--- a/gdk/wayland/gdktoplevel-wayland.c
+++ b/gdk/wayland/gdktoplevel-wayland.c
@@ -2250,6 +2250,11 @@ gdk_wayland_toplevel_set_dbus_properties (GdkToplevel *toplevel,
maybe_set_gtk_surface_dbus_properties (wayland_toplevel);
}
+void
+gdk_wayland_toplevel_destroy (GdkToplevel *toplevel)
+{
+}
+
/* }}} */
/* {{{ Toplevel API */