From fb54abb087ce6bdb3d6f45c2710d0ace1d2b828c Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 9 Apr 2015 14:09:42 +0200 Subject: plug: Remove size_allocate handler Since windows can be intermediate containers this is somewhat redundant, plus gtk_window_size_allocate() will do additional things like allocating the popovers, which was mistakenly skipped by local plugs not chaining up. https://bugzilla.gnome.org/show_bug.cgi?id=747553 --- gtk/gtkplug.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index 7f68e0a2fe..c0201c943c 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -92,8 +92,6 @@ static void gtk_plug_show (GtkWidget *widget) static void gtk_plug_hide (GtkWidget *widget); static void gtk_plug_map (GtkWidget *widget); static void gtk_plug_unmap (GtkWidget *widget); -static void gtk_plug_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); static gboolean gtk_plug_key_press_event (GtkWidget *widget, GdkEventKey *event); static gboolean gtk_plug_focus_event (GtkWidget *widget, @@ -177,7 +175,6 @@ gtk_plug_class_init (GtkPlugClass *class) widget_class->hide = gtk_plug_hide; widget_class->map = gtk_plug_map; widget_class->unmap = gtk_plug_unmap; - widget_class->size_allocate = gtk_plug_size_allocate; widget_class->focus = gtk_plug_focus; @@ -1180,43 +1177,6 @@ gtk_plug_unmap (GtkWidget *widget) GTK_WIDGET_CLASS (bin_class)->unmap (widget); } -static void -gtk_plug_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkWidget *child; - - if (gtk_widget_is_toplevel (widget)) - GTK_WIDGET_CLASS (gtk_plug_parent_class)->size_allocate (widget, allocation); - else - { - GtkBin *bin = GTK_BIN (widget); - - gtk_widget_set_allocation (widget, allocation); - - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (gtk_widget_get_window (widget), - allocation->x, allocation->y, - allocation->width, allocation->height); - - child = gtk_bin_get_child (bin); - - if (child != NULL && gtk_widget_get_visible (child)) - { - GtkAllocation child_allocation; - - child_allocation.x = child_allocation.y = gtk_container_get_border_width (GTK_CONTAINER (widget)); - child_allocation.width = - MAX (1, (gint)allocation->width - child_allocation.x * 2); - child_allocation.height = - MAX (1, (gint)allocation->height - child_allocation.y * 2); - - gtk_widget_size_allocate (child, &child_allocation); - } - - } -} - static gboolean gtk_plug_key_press_event (GtkWidget *widget, GdkEventKey *event) -- cgit v1.2.1