From e342f90a9927a16e2a2c30a247ce3d78a3cbcd6b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 4 Apr 2017 18:55:33 +0200 Subject: [PATCH] gtktoolpalette: Remove child window This is not necessary for rendering anymore, as the clip is set by the parent scrolledwindow. It's not necessary either for receiving input events. --- gtk/gtktoolpalette.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index 1c934fd2fe..87547bb0bf 100644 --- a/gtk/gtktoolpalette.c +++ b/gtk/gtktoolpalette.c @@ -223,7 +223,7 @@ gtk_tool_palette_init (GtkToolPalette *palette) dnd_target_atom_group = gdk_atom_intern_static_string (dnd_targets[1].target); } - gtk_widget_set_has_window (GTK_WIDGET (palette), TRUE); + gtk_widget_set_has_window (GTK_WIDGET (palette), FALSE); } static void @@ -602,8 +602,8 @@ gtk_tool_palette_size_allocate (GtkWidget *widget, if (remaining_space > 0) offset = 0; - x = 0; - child_allocation.y = 0; + x = allocation->x; + child_allocation.y = allocation->y; if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation) child_allocation.y -= offset; @@ -696,29 +696,6 @@ gtk_tool_palette_size_allocate (GtkWidget *widget, } } -static void -gtk_tool_palette_realize (GtkWidget *widget) -{ - GtkAllocation allocation; - GdkWindow *window; - - gtk_widget_set_realized (widget, TRUE); - - gtk_widget_get_allocation (widget, &allocation); - - window = gdk_window_new_child (gtk_widget_get_parent_window (widget), - GDK_ALL_EVENTS_MASK, - &allocation); - gtk_widget_set_window (widget, window); - gtk_widget_register_window (widget, window); - - gtk_container_forall (GTK_CONTAINER (widget), - (GtkCallback) gtk_widget_set_parent_window, - window); - - gtk_widget_queue_resize_no_redraw (widget); -} - static void gtk_tool_palette_adjustment_value_changed (GtkAdjustment *adjustment, gpointer data) @@ -892,7 +869,6 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls) wclass->measure = gtk_tool_palette_measure; wclass->size_allocate = gtk_tool_palette_size_allocate; - wclass->realize = gtk_tool_palette_realize; wclass->draw = gtk_tool_palette_draw; cclass->add = gtk_tool_palette_add;