diff options
| author | Christian Hergert <christian@hergert.me> | 2022-01-29 17:05:48 -0800 |
|---|---|---|
| committer | Christian Hergert <christian@hergert.me> | 2022-02-03 19:26:16 -0800 |
| commit | 519a44d2242c281fb8fd58dbc65456a53428d07d (patch) | |
| tree | 7a99d73e8c80a2e5beb94b0e2af7c70198f4e6ad | |
| parent | 936034e07a1e1585c04736eb81a84823abf677b9 (diff) | |
| download | gtk+-519a44d2242c281fb8fd58dbc65456a53428d07d.tar.gz | |
macos: push to head of awaiting frames
Always add to the head of awaiting frames as the list is processed
in the opposite direction.
| -rw-r--r-- | gdk/macos/gdkmacosdisplay.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c index 051a921903..9507d65c88 100644 --- a/gdk/macos/gdkmacosdisplay.c +++ b/gdk/macos/gdkmacosdisplay.c @@ -987,7 +987,11 @@ _gdk_macos_display_add_frame_callback (GdkMacosDisplay *self, if (!queue_contains (&self->awaiting_frames, &surface->frame)) { - g_queue_push_tail_link (&self->awaiting_frames, &surface->frame); + /* Processing frames is always head to tail, so push to the + * head so that we don't possibly re-enter this right after + * adding to the queue. + */ + g_queue_push_head_link (&self->awaiting_frames, &surface->frame); if (self->awaiting_frames.length == 1) gdk_display_link_source_unpause ((GdkDisplayLinkSource *)self->frame_source); |
