From a7ee1b4e855433ca62c23e3cc82c785845b6093d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 28 Jun 2019 20:54:16 +0200 Subject: [PATCH] gdksurface: Make all surfaces listen to the frame clock signals Instead of the toplevel driving popups, have the popups listen to the frame clock themselves. Otherwise, if the toplevel for some reason isn't drawn by the compositor and stops drawing new frames, popups wouldn't get painted either. --- gdk/gdksurface.c | 57 ++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 70c2c409a0..07bd67d57f 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -1404,7 +1404,6 @@ gdk_surface_paint_on_clock (GdkFrameClock *clock, void *data) { GdkSurface *surface = GDK_SURFACE (data); - GList *l; g_return_if_fail (GDK_IS_SURFACE (surface)); @@ -1425,9 +1424,6 @@ gdk_surface_paint_on_clock (GdkFrameClock *clock, gdk_surface_remove_update_surface (surface); } - for (l = surface->children; l; l = l->next) - gdk_surface_paint_on_clock (clock, l->data); - g_object_unref (surface); } @@ -3719,21 +3715,19 @@ gdk_surface_set_frame_clock (GdkSurface *surface, if (clock) { g_object_ref (clock); - if (surface->parent == NULL) - { - g_signal_connect (G_OBJECT (clock), - "flush-events", - G_CALLBACK (gdk_surface_flush_events), - surface); - g_signal_connect (G_OBJECT (clock), - "resume-events", - G_CALLBACK (gdk_surface_resume_events), - surface); - g_signal_connect (G_OBJECT (clock), - "paint", - G_CALLBACK (gdk_surface_paint_on_clock), - surface); - } + + g_signal_connect (G_OBJECT (clock), + "flush-events", + G_CALLBACK (gdk_surface_flush_events), + surface); + g_signal_connect (G_OBJECT (clock), + "resume-events", + G_CALLBACK (gdk_surface_resume_events), + surface); + g_signal_connect (G_OBJECT (clock), + "paint", + G_CALLBACK (gdk_surface_paint_on_clock), + surface); if (surface->update_freeze_count == 0) _gdk_frame_clock_inhibit_freeze (clock); @@ -3741,21 +3735,18 @@ gdk_surface_set_frame_clock (GdkSurface *surface, if (surface->frame_clock) { - if (surface->parent == NULL) - { - if (surface->frame_clock_events_paused) - gdk_surface_resume_events (surface->frame_clock, G_OBJECT (surface)); + if (surface->frame_clock_events_paused) + gdk_surface_resume_events (surface->frame_clock, G_OBJECT (surface)); - g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock), - G_CALLBACK (gdk_surface_flush_events), - surface); - g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock), - G_CALLBACK (gdk_surface_resume_events), - surface); - g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock), - G_CALLBACK (gdk_surface_paint_on_clock), - surface); - } + g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock), + G_CALLBACK (gdk_surface_flush_events), + surface); + g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock), + G_CALLBACK (gdk_surface_resume_events), + surface); + g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock), + G_CALLBACK (gdk_surface_paint_on_clock), + surface); if (surface->update_freeze_count == 0) _gdk_frame_clock_uninhibit_freeze (surface->frame_clock);