[Xfce4-commits] <xfce4-terminal:master> Keep window with normal preferences dialog.

Nick Schermer noreply at xfce.org
Sat Dec 29 22:44:05 CET 2012


Updating branch refs/heads/master
         to d729d37feebbdb0dd5f7fd7d39f56f23aeec9b8e (commit)
       from a16adab19f67b72b609c413a598e3649150f34a2 (commit)

commit d729d37feebbdb0dd5f7fd7d39f56f23aeec9b8e
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Dec 29 15:52:21 2012 +0100

    Keep window with normal preferences dialog.

 terminal/terminal-window.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 245036d..ed5f5c1 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -1366,6 +1366,21 @@ terminal_window_action_select_all (GtkAction      *action,
 
 
 static void
+terminal_window_action_prefs_died (gpointer  user_data,
+                                   GObject  *where_the_object_was)
+{
+  TerminalWindow *window = TERMINAL_WINDOW (user_data);
+
+  window->preferences_dialog = NULL;
+  window->n_child_windows--;
+
+  if (window->drop_down)
+    terminal_activate_window (GTK_WINDOW (window));
+}
+
+
+
+static void
 terminal_window_action_prefs (GtkAction      *action,
                               TerminalWindow *window)
 {
@@ -1374,8 +1389,9 @@ terminal_window_action_prefs (GtkAction      *action,
       window->preferences_dialog = terminal_preferences_dialog_new ();
       if (G_LIKELY (window->preferences_dialog != NULL))
         {
-          g_object_add_weak_pointer (G_OBJECT (window->preferences_dialog),
-                                     (gpointer) &window->preferences_dialog);
+          window->n_child_windows++;
+          g_object_weak_ref (G_OBJECT (window->preferences_dialog),
+                             terminal_window_action_prefs_died, window);
         }
     }
 


More information about the Xfce4-commits mailing list