x11/surface: Clear compute_size idle source also when destroying
authorJonas Ådahl <jadahl@gmail.com>
Fri, 10 Mar 2023 22:30:51 +0000 (23:30 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 10 Mar 2023 22:34:50 +0000 (23:34 +0100)
Doing it on hide() is not enough, since in some edge cases we didn't
ever actually map, we just attempted to compute the size, e.g. in
response to a ConfigureNotify event, then the window was destroyed.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2678

gdk/x11/gdksurface-x11.c

index 9ae867eb6f6eee88996281eb970b3044f4eae66a..a76e4824f2ed1c0e2c1f002257c3fcbda60c9f16 100644 (file)
@@ -1358,6 +1358,7 @@ gdk_x11_surface_destroy (GdkSurface *surface,
 
   unhook_surface_changed (surface);
   disconnect_frame_clock (surface);
+  g_clear_handle_id (&impl->compute_size_source_id, g_source_remove);
 
   if (impl->cairo_surface)
     {