[Xfce4-commits] [apps/xfce4-terminal] 01/01: Disconnect close Set Title dialog handlers on closing window

noreply at xfce.org noreply at xfce.org
Tue Feb 7 20:50:45 CET 2017


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 437d5b3d1a2e0a1bce9341077b9dfb6e6329b7bc
Author: Igor <f2404 at yandex.ru>
Date:   Tue Feb 7 22:49:15 2017 +0300

    Disconnect close Set Title dialog handlers on closing window
    
    To avoid gtk criticals if a dialog is open
---
 terminal/terminal-window.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 5118aa2..fdee2a3 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -249,6 +249,8 @@ static void         terminal_window_toggle_menubar                (GtkWidget
                                                                    TerminalWindow         *window);
 static void         terminal_window_menubar_deactivate            (GtkWidget              *widget,
                                                                    TerminalWindow         *window);
+static void         title_dialog_close                            (GtkWidget              *dialog,
+                                                                   TerminalWindow         *window);
 
 
 
@@ -569,10 +571,21 @@ terminal_window_delete_event (GtkWidget   *widget,
                               GdkEventAny *event)
 {
   TerminalWindow *window = TERMINAL_WINDOW (widget);
+  GtkWidget      *child;
+  gint            n_pages, i;
 
   /* disconnect remove signal if we're closing the window */
   if (terminal_window_confirm_close (window))
     {
+      /* disconnect handlers for closing Set Title dialog */
+      n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->priv->notebook));
+      for (i = 0; i < n_pages; i++)
+        {
+          child = gtk_notebook_get_nth_page (GTK_NOTEBOOK (window->priv->notebook), i);
+          g_signal_handlers_disconnect_by_func (G_OBJECT (child),
+              G_CALLBACK (title_dialog_close), window);
+        }
+
       /* avoid a lot of page remove calls */
       g_signal_handlers_disconnect_by_func (G_OBJECT (window->priv->notebook),
           G_CALLBACK (terminal_window_notebook_page_removed), window);
@@ -1865,8 +1878,7 @@ title_dialog_close (GtkWidget      *dialog,
 
   /* close the dialog */
   window->priv->n_child_windows--;
-  if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->priv->notebook)) > 0)
-    gtk_widget_destroy (window->priv->title_dialog);
+  gtk_widget_destroy (window->priv->title_dialog);
   window->priv->title_dialog = NULL;
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list