forked from AuroraMiddleware/gtk
infobar: fix initial window position
Call gtk_widget_set_allocation after chaining up to parent class to ensure that GtkInfoBar has correct allocation. Otherwise x and y is set to zero causing wrong window position in gtk_info_bar_realize. This fixes info-bar-message-types.ui reftest. https://gitlab.gnome.org/GNOME/gtk/merge_requests/1428
This commit is contained in:
parent
88249f7077
commit
840ef37bfd
@ -375,8 +375,16 @@ static void
|
||||
gtk_info_bar_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkAllocation tmp_allocation;
|
||||
GdkWindow *window;
|
||||
|
||||
tmp_allocation = *allocation;
|
||||
tmp_allocation.x = 0;
|
||||
tmp_allocation.y = 0;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->size_allocate (widget,
|
||||
&tmp_allocation);
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
window = gtk_widget_get_window (widget);
|
||||
@ -384,11 +392,6 @@ gtk_info_bar_size_allocate (GtkWidget *widget,
|
||||
gdk_window_move_resize (window,
|
||||
allocation->x, allocation->y,
|
||||
allocation->width, allocation->height);
|
||||
|
||||
allocation->x = 0;
|
||||
allocation->y = 0;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->size_allocate (widget, allocation);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user