[gnome-shell/gnome-3-10] shell-app: Unref running state when window count drops to zero
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-10] shell-app: Unref running state when window count drops to zero
- Date: Thu, 23 Jan 2014 17:46:44 +0000 (UTC)
commit a6d0e89ecbc4e8c69cdbf79bc48bd6e4d7e71568
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jan 23 11:51:44 2014 -0500
shell-app: Unref running state when window count drops to zero
With the lastest ShellApp changes, an app is considered stopped
when the last "interesting" window is closed. However the app
may still track non-interesting windows, so if we unref the
running state on the state transition, we hit an assertion later-on
when trying to remove the non-interesting window.
Fix this by keeping the running state around until the last window
is closed.
https://bugzilla.gnome.org/show_bug.cgi?id=722840
src/shell-app.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 20a2e24..30ea6b8 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -901,12 +901,6 @@ shell_app_state_transition (ShellApp *app,
state == SHELL_APP_STATE_STARTING));
app->state = state;
- if (app->state == SHELL_APP_STATE_STOPPED && app->running_state)
- {
- unref_running_state (app->running_state);
- app->running_state = NULL;
- }
-
_shell_app_system_notify_app_state_changed (shell_app_system_get_default (), app);
g_object_notify (G_OBJECT (app), "state");
@@ -1068,6 +1062,9 @@ _shell_app_remove_window (ShellApp *app,
if (app->running_state->interesting_windows == 0)
shell_app_state_transition (app, SHELL_APP_STATE_STOPPED);
+ if (app->running_state && app->running_state->windows == NULL)
+ g_clear_pointer (&app->running_state, unref_running_state);
+
g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]