Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-07-12 18:18:41 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-07-12 18:18:41 (GMT)
commit167635647c6f1c6077cdb159755e5e15e1c50f82 (patch)
treeb06cdb4af7b06d9e8a624bc92ce66e2c0de524b0 /shell/ev-window.c
parenta945ec884efd6cd43f873b004ba17b9f7f8146e0 (diff)
[shell] Flush DBus connection after emitting closed signal for the last window
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 168ed67..c7e9c6d 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -6261,10 +6261,6 @@ ev_window_emit_closed (EvWindow *window)
if (!connection)
return;
- /* TODO: figure out if this is the last window and use
- * g_dbus_connection_flush_sync() to make sure the signal
- * is emitted.
- */
g_dbus_connection_emit_signal (connection,
NULL,
window->priv->dbus_object_path,
@@ -6276,7 +6272,15 @@ ev_window_emit_closed (EvWindow *window)
g_printerr ("Failed to emit DBus signal Closed: %s\n",
error->message);
g_error_free (error);
+
+ return;
}
+
+ /* If this is the last window call g_dbus_connection_flush_sync()
+ * to make sure the signal is emitted.
+ */
+ if (ev_application_get_n_windows (EV_APP) == 1)
+ g_dbus_connection_flush_sync (connection, NULL, NULL);
}
static void