surface: Only unpause events if we paused them
authorMatthias Clasen <mclasen@redhat.com>
Sun, 29 Dec 2019 18:31:36 +0000 (13:31 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 29 Dec 2019 18:35:36 +0000 (13:35 -0500)
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

index 2cdc15e687b9bc0df7066535bd5e10ff76467abe..7158c253f5d11c0a2c3910144c613159183d5f5e 100644 (file)
@@ -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