[gtk/wip/baedert/for-master: 4/5] sdf



commit 8fc62cdbe6ff625acc778ecf227f5beaed817844
Author: Timm Bäder <mail baedert org>
Date:   Sat Oct 5 11:33:33 2019 +0200

    sdf

 gtk/gtkassistant.c |  4 ++--
 gtk/gtkheaderbar.c | 20 ++++++++++++++++++++
 gtk/gtkwindow.c    |  4 ++--
 3 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index aa0f8d0f16..b57fd90cda 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1002,13 +1002,13 @@ set_current_page (GtkAssistant *assistant,
       /* find the best button to focus */
       button[0] = priv->apply;
       button[1] = priv->close;
-      button[2] = priv->forward;
+      button[2] = NULL;//priv->forward;
       button[3] = priv->back;
       button[4] = priv->cancel;
       button[5] = priv->last;
       for (i = 0; i < 6; i++)
         {
-          if (gtk_widget_get_visible (button[i]) &&
+          if (button[i] && gtk_widget_get_visible (button[i]) &&
               gtk_widget_get_sensitive (button[i]))
             {
               gtk_widget_grab_focus (button[i]);
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 7141a2d300..0c5be8c450 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -816,6 +816,26 @@ gtk_header_bar_dispose (GObject *object)
       g_clear_object (&priv->label_sizing_box);
     }
 
+  /* Clean start/end box manually here so the visible notify won't fire on a
+   * headerbar that's in the middle of being disposed */
+  if (priv->start_box)
+    for (w = gtk_widget_get_first_child (priv->start_box);
+         w != NULL;
+         w = gtk_widget_get_next_sibling (w))
+      {
+        if (w != priv->titlebar_start_box)
+          g_signal_handlers_disconnect_by_func (w, notify_child_cb, object);
+      }
+
+  if (priv->end_box)
+    for (w = gtk_widget_get_first_child (priv->end_box);
+         w != NULL;
+         w = gtk_widget_get_next_sibling (w))
+      {
+        if (w != priv->titlebar_end_box)
+          g_signal_handlers_disconnect_by_func (w, notify_child_cb, object);
+      }
+
   g_clear_pointer (&priv->custom_title, gtk_widget_unparent);
   g_clear_pointer (&priv->label_box, gtk_widget_unparent);
   g_clear_pointer (&priv->start_box, gtk_widget_unparent);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 736b612a65..d3ea0baf77 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -3069,10 +3069,10 @@ gtk_window_dispose (GObject *object)
   if (priv->group)
     gtk_window_group_remove_window (priv->group, window);
 
-   gtk_window_free_key_hash (window);
+  gtk_window_free_key_hash (window);
 
-  G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object);
   unset_titlebar (window);
+  G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object);
 
   while (!g_queue_is_empty (&priv->popovers))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]