From 90979faedd70d569f16f56a546cf330dc116d636 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 5 Aug 2009 20:07:30 -0400 Subject: [PATCH] ShellAppMonitor: Fix case of not seeing apps being closed Remove the app from the window_to_app hash *before* emitting CHANGED, otherwise a signal handler could see stale data. --- src/shell-app-monitor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shell-app-monitor.c b/src/shell-app-monitor.c index 57107047e..f3bf7050e 100644 --- a/src/shell-app-monitor.c +++ b/src/shell-app-monitor.c @@ -532,10 +532,11 @@ shell_app_monitor_on_window_removed (MetaWorkspace *workspace, self->watched_window = NULL; usage->window_count--; + /* Remove before emitting */ + g_hash_table_remove (self->window_to_app, window); + if (usage->window_count == 0) g_signal_emit (self, signals[CHANGED], 0); - - g_hash_table_remove (self->window_to_app, window); } static void