]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktoolpalette.c
filechooserbutton: Don't duplicate tests for GTK_RESPONSE_DELETE_EVENT
[~andy/gtk] / gtk / gtktoolpalette.c
index 0655bffeb01f67ecfd69bb9b712a81dd1b0cb82a..3d9d7f3ccca7b518a604299a5dcec9c8366836f7 100644 (file)
@@ -383,6 +383,14 @@ gtk_tool_palette_dispose (GObject *object)
       palette->priv->text_size_group = NULL;
     }
 
+  if (palette->priv->settings_connection > 0)
+    {
+      g_signal_handler_disconnect (palette->priv->settings, palette->priv->settings_connection);
+      palette->priv->settings_connection = 0;
+    }
+
+  g_clear_object (&palette->priv->settings);
+
   G_OBJECT_CLASS (gtk_tool_palette_parent_class)->dispose (object);
 }
 
@@ -719,13 +727,15 @@ gtk_tool_palette_realize (GtkWidget *widget)
   attributes.event_mask = gtk_widget_get_events (widget)
                          | GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK
                          | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
-                         | GDK_BUTTON_MOTION_MASK;
+                         | GDK_BUTTON_MOTION_MASK
+                         | GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK
+                         | GDK_TOUCH_MASK;
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
 
   window = gdk_window_new (gtk_widget_get_parent_window (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 (gtk_widget_get_style_context (widget),
                                     window);
@@ -932,6 +942,7 @@ gtk_tool_palette_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);
   }
 
@@ -989,7 +1000,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
    * GtkToolPalette:icon-size:
    *
    * The size of the icons in a tool palette is normally determined by
-   * the #GtkSettings:toolbar-icon-size setting. When this property is set,
+   * the #GtkSettings:gtk-toolbar-icon-size setting. When this property is set,
    * it overrides the setting.
    *
    * This should only be used for special-purpose tool palettes, normal
@@ -1289,9 +1300,9 @@ gtk_tool_palette_get_style (GtkToolPalette *palette)
   return palette->priv->style;
 }
 
-gint
-_gtk_tool_palette_compare_groups (gconstpointer a,
-                                  gconstpointer b)
+static gint
+gtk_tool_palette_compare_groups (gconstpointer a,
+                                 gconstpointer b)
 {
   const GtkToolItemGroupInfo *group_a = a;
   const GtkToolItemGroupInfo *group_b = b;
@@ -1342,7 +1353,7 @@ gtk_tool_palette_set_group_position (GtkToolPalette   *palette,
   group_new->pos = position;
   group_old->pos = old_position;
 
-  g_ptr_array_sort (palette->priv->groups, _gtk_tool_palette_compare_groups);
+  g_ptr_array_sort (palette->priv->groups, gtk_tool_palette_compare_groups);
 
   gtk_widget_queue_resize (GTK_WIDGET (palette));
 }
@@ -1673,7 +1684,7 @@ gtk_tool_palette_get_drag_item (GtkToolPalette         *palette,
 /**
  * gtk_tool_palette_set_drag_source:
  * @palette: a #GtkToolPalette
- * @targets: the #GtkToolPaletteDragTarget<!-- -->s
+ * @targets: the #GtkToolPaletteDragTargets
  *     which the widget should support
  *
  * Sets the tool palette as a drag source.
@@ -1712,7 +1723,7 @@ gtk_tool_palette_set_drag_source (GtkToolPalette            *palette,
  * @widget: a #GtkWidget which should be a drag destination for @palette
  * @flags: the flags that specify what actions GTK+ should take for drops
  *     on that widget
- * @targets: the #GtkToolPaletteDragTarget<!-- -->s which the widget
+ * @targets: the #GtkToolPaletteDragTargets which the widget
  *     should support
  * @actions: the #GdkDragAction<!-- -->s which the widget should suppport
  *