[gtk/matthiasc/for-master] surface: Only unpause events if we paused them



commit ad6fe9d6a0998ad7dd7c8a73112ca3ab1461acce
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Dec 29 13:31:36 2019 -0500

    surface: Only unpause events if we paused them
    
    When a new popup surface is created, it may end up
    getting a resume-events signal from its frame clock
    without having seen a flush-events first.
    
    Don't unpause events in that case, since it messes
    up the displays pause counter.
    
    This was causing criticals with tooltips.

 gdk/gdksurface.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 2cdc15e687..7158c253f5 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -3614,7 +3614,6 @@ gdk_surface_flush_events (GdkFrameClock *clock,
   _gdk_display_pause_events (surface->display);
 
   gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
-
   surface->frame_clock_events_paused = TRUE;
 }
 
@@ -3624,9 +3623,11 @@ gdk_surface_resume_events (GdkFrameClock *clock,
 {
   GdkSurface *surface = GDK_SURFACE (data);
 
-  _gdk_display_unpause_events (surface->display);
-
-  surface->frame_clock_events_paused = FALSE;
+  if (surface->frame_clock_events_paused)
+    {
+      _gdk_display_unpause_events (surface->display);
+      surface->frame_clock_events_paused = FALSE;
+    }
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]