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
This commit is contained in:
Mario Sanchez Prada 2017-09-29 11:47:31 +01:00
parent 6321bbb773
commit b5f5a594ba

View File

@ -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);
}