summaryrefslogtreecommitdiff
path: root/gdk/x11
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-05-24 01:55:57 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-05-28 20:25:17 +0000
commit2aa0ceaeca69e1eb8a5cc620126dad2625de2e53 (patch)
tree8603668a5a5e99f51833c3f8eb0ed47b1a42ae7d /gdk/x11
parent28addd377575525eefb87c89ae6f60b8839e8861 (diff)
downloadgtk+-2aa0ceaeca69e1eb8a5cc620126dad2625de2e53.tar.gz
x11: Disconnect from the frame clock
The frame clock can now survive its surface, so we need to disconnect signal handlers.
Diffstat (limited to 'gdk/x11')
-rw-r--r--gdk/x11/gdksurface-x11.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index afdb6c243b..d98b4e6bbf 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -773,6 +773,25 @@ connect_frame_clock (GdkSurface *surface)
}
}
+static void
+disconnect_frame_clock (GdkSurface *surface)
+{
+ GdkX11Surface *impl;
+
+ impl = GDK_X11_SURFACE (surface);
+ if (impl->frame_clock_connected)
+ {
+ GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (surface);
+
+ g_signal_handlers_disconnect_by_func (frame_clock,
+ on_frame_clock_before_paint, surface);
+ g_signal_handlers_disconnect_by_func (frame_clock,
+ on_frame_clock_after_paint, surface);
+
+ impl->frame_clock_connected = FALSE;
+ }
+}
+
GdkSurface *
_gdk_x11_display_create_surface (GdkDisplay *display,
GdkSurfaceType surface_type,
@@ -959,6 +978,7 @@ gdk_x11_surface_destroy (GdkSurface *surface,
gdk_toplevel_x11_free_contents (GDK_SURFACE_DISPLAY (surface), toplevel);
unhook_surface_changed (surface);
+ disconnect_frame_clock (surface);
if (impl->cairo_surface)
{