[evolution] Bug 621210 - Can't get the shell back after closing it



commit 62f9c59af9400350069ddfcd2327760e81e5ab70
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jun 20 14:36:34 2010 -0400

    Bug 621210 - Can't get the shell back after closing it

 shell/e-shell.c |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/shell/e-shell.c b/shell/e-shell.c
index ec61d50..5c00277 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -666,6 +666,35 @@ shell_constructed (GObject *object)
 }
 
 static UniqueResponse
+shell_message_handle_activate (EShell *shell,
+                               UniqueMessageData *data)
+{
+	GList *watched_windows;
+	GdkScreen *screen;
+
+	screen = unique_message_data_get_screen (data);
+	watched_windows = e_shell_get_watched_windows (shell);
+
+	/* Present the first EShellWindow, if found. */
+	while (watched_windows != NULL) {
+		GtkWindow *window = GTK_WINDOW (watched_windows->data);
+
+		if (E_IS_SHELL_WINDOW (window)) {
+			gtk_window_set_screen (window, screen);
+			gtk_window_present (window);
+			return UNIQUE_RESPONSE_OK;
+		}
+
+		watched_windows = g_list_next (watched_windows);
+	}
+
+	/* No EShellWindow found, so create one. */
+	e_shell_create_shell_window (shell, NULL);
+
+	return UNIQUE_RESPONSE_OK;
+}
+
+static UniqueResponse
 shell_message_handle_new (EShell *shell,
                           UniqueMessageData *data)
 {
@@ -731,7 +760,7 @@ shell_message_received (UniqueApp *app,
 
 	switch (command) {
 		case UNIQUE_ACTIVATE:
-			break;  /* use the default behavior */
+			return shell_message_handle_activate (shell, data);
 
 		case UNIQUE_NEW:
 			return shell_message_handle_new (shell, data);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]