X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtktoolitemgroup.c;h=d6aa8258c6bdcc9371231fb29f75f081dfc744e5;hb=feb64f40b0f50735104da0a7fdafbe480763c180;hp=40b10e38f4acb7aa9da5fd9e517631b71ebca62a;hpb=8bb0773535fdd474cd1d4f0cbcc3f8465f8b2f88;p=~andy%2Fgtk diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c index 40b10e38f..d6aa8258c 100644 --- a/gtk/gtktoolitemgroup.c +++ b/gtk/gtktoolitemgroup.c @@ -12,8 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * License along with this library. If not, see . * * Authors: * Mathias Hasselmann @@ -230,6 +229,7 @@ gtk_tool_item_group_screen_changed (GtkWidget *widget, if (old_settings) { g_signal_handler_disconnect (old_settings, priv->settings_connection); + priv->settings_connection = 0; g_object_unref (old_settings); } @@ -304,14 +304,10 @@ gtk_tool_item_group_header_draw_cb (GtkWidget *widget, y = 0; } - /* The expander is the only animatable region */ - gtk_style_context_push_animatable_region (context, GUINT_TO_POINTER (1)); - gtk_render_expander (context, cr, x, y, priv->expander_size, priv->expander_size); - gtk_style_context_pop_animatable_region (context); gtk_style_context_restore (context); return FALSE; @@ -524,6 +520,14 @@ gtk_tool_item_group_dispose (GObject *object) priv->toplevel = NULL; } + if (priv->settings_connection > 0) + { + g_signal_handler_disconnect (priv->settings, priv->settings_connection); + priv->settings_connection = 0; + } + + g_clear_object (&priv->settings); + G_OBJECT_CLASS (gtk_tool_item_group_parent_class)->dispose (object); } @@ -1237,7 +1241,7 @@ gtk_tool_item_group_realize (GtkWidget *widget) &attributes, attributes_mask); gtk_widget_set_window (widget, window); - gdk_window_set_user_data (window, widget); + gtk_widget_register_window (widget, window); gtk_style_context_set_background (context, window); @@ -1866,7 +1870,7 @@ gtk_tool_item_group_animation_cb (gpointer data) gint64 timestamp = gtk_tool_item_group_get_animation_timestamp (group); gboolean retval; - GDK_THREADS_ENTER (); + gdk_threads_enter (); /* Enque this early to reduce number of expose events. */ gtk_widget_queue_resize_no_redraw (GTK_WIDGET (group)); @@ -1879,7 +1883,7 @@ gtk_tool_item_group_animation_cb (gpointer data) retval = (priv->animation_timeout != NULL); - GDK_THREADS_LEAVE (); + gdk_threads_leave (); return retval; } @@ -1910,8 +1914,6 @@ gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group, GTK_WIDGET (group)); if (collapsed != priv->collapsed) { - GtkStyleContext *context; - if (priv->animation) { if (priv->animation_timeout) @@ -1924,19 +1926,6 @@ gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group, gtk_tool_item_group_animation_cb, group, NULL); g_source_attach (priv->animation_timeout, NULL); - - context = gtk_widget_get_style_context (gtk_bin_get_child (GTK_BIN (priv->header))); - - gtk_style_context_save (context); - gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER); - - gtk_style_context_notify_state_change (context, - gtk_widget_get_window (priv->header), - GUINT_TO_POINTER (1), - GTK_STATE_FLAG_ACTIVE, - !collapsed); - - gtk_style_context_restore (context); } else gtk_tool_item_group_force_expose (group);