[seahorse] keyserver-results: Set the main Seahorse window as the keyserver results' transient parent
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse] keyserver-results: Set the main Seahorse window as the keyserver results' transient parent
- Date: Tue, 15 Apr 2014 14:39:31 +0000 (UTC)
commit bce2feef06340bcf93dd04e67203ab66f78edb40
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Apr 9 18:07:30 2014 -0500
keyserver-results: Set the main Seahorse window as the keyserver results' transient parent
Otherwise the keyserver results window can appear behind the main Seahorse window.
https://bugzilla.gnome.org/show_bug.cgi?id=727926
pgp/seahorse-keyserver-results.c | 5 +++--
pgp/seahorse-keyserver-results.h | 2 +-
pgp/seahorse-keyserver-search.c | 9 +++++++--
3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/pgp/seahorse-keyserver-results.c b/pgp/seahorse-keyserver-results.c
index 285d318..84715e0 100644
--- a/pgp/seahorse-keyserver-results.c
+++ b/pgp/seahorse-keyserver-results.c
@@ -490,14 +490,14 @@ on_search_completed (GObject *source,
}
/**
* seahorse_keyserver_results_show:
- * @parent: A GTK window as parent (or NULL)
* @search_text: The test to search for
+ * @parent: A GTK window as parent (or NULL)
*
* Creates a search results window and adds the operation to it's progress status.
*
*/
void
-seahorse_keyserver_results_show (const char* search_text)
+seahorse_keyserver_results_show (const char* search_text, GtkWindow *parent)
{
SeahorseKeyserverResults* self;
GCancellable *cancellable;
@@ -508,6 +508,7 @@ seahorse_keyserver_results_show (const char* search_text)
self = g_object_new (SEAHORSE_TYPE_KEYSERVER_RESULTS,
"ui-name", "keyserver-results",
"search", search_text,
+ "transient-for", parent,
NULL);
/* Destorys itself with destroy */
diff --git a/pgp/seahorse-keyserver-results.h b/pgp/seahorse-keyserver-results.h
index d59fbcd..34823df 100644
--- a/pgp/seahorse-keyserver-results.h
+++ b/pgp/seahorse-keyserver-results.h
@@ -54,7 +54,7 @@ struct _SeahorseKeyserverResultsClass {
GType seahorse_keyserver_results_get_type (void);
-void seahorse_keyserver_results_show (const gchar *search_text);
+void seahorse_keyserver_results_show (const gchar *search_text, GtkWindow *parent);
const gchar* seahorse_keyserver_results_get_search (SeahorseKeyserverResults* self);
diff --git a/pgp/seahorse-keyserver-search.c b/pgp/seahorse-keyserver-search.c
index 7dadeeb..05de3a3 100644
--- a/pgp/seahorse-keyserver-search.c
+++ b/pgp/seahorse-keyserver-search.c
@@ -407,6 +407,7 @@ on_keyserver_search_ok_clicked (GtkButton *button, SeahorseWidget *swidget)
KeyserverSelection *selection;
const gchar *search;
GtkWidget *widget;
+ GtkWindow *parent;
widget = seahorse_widget_get_widget (swidget, "search-text");
g_return_if_fail (widget != NULL);
@@ -422,8 +423,12 @@ on_keyserver_search_ok_clicked (GtkButton *button, SeahorseWidget *swidget)
g_settings_set_strv (seahorse_application_settings (NULL), "last-search-servers",
selection->all ? NULL : (const gchar * const*)selection->uris->pdata);
- /* Open the new result window */
- seahorse_keyserver_results_show (search);
+ /* Open the new result window; its transient parent is *our* transient
+ * parent (Seahorse's primary window), not ourselves, as *we* will
+ * disappear when "OK" is clicked.
+ */
+ parent = gtk_window_get_transient_for (GTK_WINDOW (seahorse_widget_get_widget (swidget,
swidget->name)));
+ seahorse_keyserver_results_show (search, parent);
free_keyserver_selection (selection);
seahorse_widget_destroy (swidget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]