aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-10-13 22:24:10 +0800
committerMilan Crha <mcrha@redhat.com>2009-10-13 22:24:10 +0800
commite06b88c4fda627599d7c1a33ddec0a35a4374e4f (patch)
treea862b4d3909923719ab03936ec60dfc00f185ba8 /shell/e-shell.c
parentdc2953040b0fb9576411d2f145e7e6ff11dd989a (diff)
downloadgsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.gz
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.bz2
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.lz
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.xz
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.zst
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.zip
Bug #594471 - Shouldn't call e_error_new/run with NULL 'parent'
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r--shell/e-shell.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index bf664649fc..924441fa56 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -1348,6 +1348,33 @@ e_shell_get_watched_windows (EShell *shell)
}
/**
+ * e_shell_get_active_window:
+ * @shell: an #EShell; can be NULL, in that case is used
+ * result of @e_shell_get_default
+ *
+ * Returns: an active, the most recently focused, window.
+ **/
+GtkWindow *
+e_shell_get_active_window (EShell *shell)
+{
+ GList *w;
+ GtkWindow *window = NULL;
+
+ if (!shell)
+ shell = e_shell_get_default ();
+
+ g_return_val_if_fail (shell != NULL, NULL);
+
+ for (w = e_shell_get_watched_windows (shell); w && !window; w = w->next) {
+ window = GTK_WINDOW (w->data);
+ }
+
+ g_return_val_if_fail (window != NULL, NULL);
+
+ return window;
+}
+
+/**
* e_shell_send_receive:
* @shell: an #EShell
* @parent: the parent #GtkWindow