summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Keller <skeller@gnome.org>2022-05-13 19:08:31 +0200
committerFlorian Müllner <fmuellner@gnome.org>2022-05-28 14:15:30 +0200
commitdb52c904eed2056af8c4eba3084f63c2a156a07b (patch)
treed64f9e6ab4f6e095b709c8cd00c97f6aa6c7cef3
parentf998a917577fff89462fd621307b2c51844fd06d (diff)
downloadmutter-db52c904eed2056af8c4eba3084f63c2a156a07b.tar.gz
display: Properly store later ID when adding window to queue
The code is already trying to avoid creating new laters when there already is one for the queue type, but this wasn't working because the ID of the later was never stored after creating a new one. This would then result in as many laters as meta_display_queue_window() was called and all of them would run the handler function, even if only the first one had a non-empty window queue. Similarly this was causing the later to not be removed if the window queue got empty after meta_display_unqueue_window(). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2414> (cherry picked from commit bc9762eebb1ab0b812118dd126b9a9b5c031bec8)
-rw-r--r--src/core/display.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/display.c b/src/core/display.c
index 590df83a1..66b75b1e9 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -4108,10 +4108,11 @@ meta_display_queue_window (MetaDisplay *display,
run_data = g_new0 (MetaQueueRunData, 1);
run_data->display = display;
run_data->queue_idx = queue_idx;
- meta_laters_add (laters,
- window_queue_later_when[queue_idx],
- window_queue_run_later_func,
- run_data, g_free);
+ priv->queue_later_ids[queue_idx] =
+ meta_laters_add (laters,
+ window_queue_later_when[queue_idx],
+ window_queue_run_later_func,
+ run_data, g_free);
}
}
}