From b5f5a594ba7ad96bf9d9a2bbda214dd7e33f7d47 Mon Sep 17 00:00:00 2001 From: Mario Sanchez Prada Date: Fri, 29 Sep 2017 11:47:31 +0100 Subject: [PATCH] shell-app: Don't transition to STOPPED while still in the STARTING state Similar to what it's done in _shell_app_add_window(), rely on calling shell_app_sync_running_state() when removing windows too, to avoid transitioning to STOPPED while it's still in the STARTING state. This makes the logic compliant with the startup notification spec and prevents stopping an application too early if it has a splash screen that has been closed before the application's main window is shown. https://bugzilla.gnome.org/show_bug.cgi?id=787905 --- src/shell-app.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/shell-app.c b/src/shell-app.c index 335147c19..dbf537ce9 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -1067,16 +1067,10 @@ _shell_app_remove_window (ShellApp *app, if (!meta_window_is_skip_taskbar (window)) app->running_state->interesting_windows--; + shell_app_sync_running_state (app); if (app->running_state->windows == NULL) - { - g_clear_pointer (&app->running_state, unref_running_state); - shell_app_state_transition (app, SHELL_APP_STATE_STOPPED); - } - else - { - shell_app_sync_running_state (app); - } + g_clear_pointer (&app->running_state, unref_running_state); g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0); }