diff options
author | Benjamin Otte <otte@redhat.com> | 2022-07-10 21:15:22 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2022-07-10 21:33:32 +0200 |
commit | 988e20cd53c08cf69aeb43f40f63c47ab218ffd5 (patch) | |
tree | 66acd6287491cbdc0ecf1d3befba37cad2358599 | |
parent | 7536513ef82aa52d00d5fa90492239d0727bf942 (diff) | |
download | gtk+-988e20cd53c08cf69aeb43f40f63c47ab218ffd5.tar.gz |
frameclock: Run paint idle from flush idle
Don't return to the main loop, instead force a run of the paint idle.
The paint idle will know to skip all the phases that aren't requested.
This is critically important becuase gdksurface.c assumes the
FLUSH_EVENTS and RESUME_EVENTS phases are matched, and we cannot
guarantee that if we return to the main loop and let various reentrant
code change the frame clock state.
This would lead to bugs with events being paused and never unpaused
again or even crashes.
Fixes #4941
-rw-r--r-- | gdk/gdkframeclockidle.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk/gdkframeclockidle.c b/gdk/gdkframeclockidle.c index 10c4e5cd2a..9c0c7263dd 100644 --- a/gdk/gdkframeclockidle.c +++ b/gdk/gdkframeclockidle.c @@ -373,6 +373,9 @@ gdk_frame_clock_flush_idle (void *data) else priv->phase = GDK_FRAME_CLOCK_PHASE_NONE; + g_clear_handle_id (&priv->paint_idle_id, g_source_remove); + gdk_frame_clock_paint_idle (data); + return FALSE; } |