From bc9762eebb1ab0b812118dd126b9a9b5c031bec8 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Fri, 13 May 2022 19:08:31 +0200 Subject: [PATCH] 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: --- src/core/display.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 869c9e32a..14b390346 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); } } }