[gedit] preferences: associate the window with the app
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] preferences: associate the window with the app
- Date: Sat, 11 Jan 2014 05:52:00 +0000 (UTC)
commit a5ad3eddaf60decabb379f00485f0178d6fb0af7
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Jan 10 13:09:10 2014 -0500
preferences: associate the window with the app
This allows the app to stay open if the preferences window is open.
Also, allow the preferences window to be created without a transient
window for it to be associated with.
Make sure we never return the preferences window as the active window.
https://bugzilla.gnome.org/show_bug.cgi?id=721952
gedit/gedit-app.c | 2 +-
gedit/gedit-preferences-dialog.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 374f5da..d14f0a5 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -681,7 +681,7 @@ get_active_window (GtkApplication *app)
{
GtkWindow *window = l->data;
- if (is_in_viewport (window, screen, workspace, viewport_x, viewport_y))
+ if (GEDIT_IS_WINDOW (window) && is_in_viewport (window, screen, workspace, viewport_x,
viewport_y))
{
return GEDIT_WINDOW (window);
}
diff --git a/gedit/gedit-preferences-dialog.c b/gedit/gedit-preferences-dialog.c
index f4b2a2a..7796bdb 100644
--- a/gedit/gedit-preferences-dialog.c
+++ b/gedit/gedit-preferences-dialog.c
@@ -1121,11 +1121,11 @@ gedit_show_preferences_dialog (GeditWindow *parent)
{
gedit_debug (DEBUG_PREFS);
- g_return_if_fail (GEDIT_IS_WINDOW (parent));
-
if (preferences_dialog == NULL)
{
- preferences_dialog = GTK_WIDGET (g_object_new (GEDIT_TYPE_PREFERENCES_DIALOG, NULL));
+ preferences_dialog = GTK_WIDGET (g_object_new (GEDIT_TYPE_PREFERENCES_DIALOG,
+ "application", g_application_get_default (),
+ NULL));
g_signal_connect (preferences_dialog,
"destroy",
G_CALLBACK (gtk_widget_destroyed),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]