Skip to content
  • Alexander Larsson's avatar
    GtkOverlay: Don't allocate child except in size_allocate · 785a9162
    Alexander Larsson authored
    We were calling gtk_overlay_child_allocate() both in realize
    and in add as we wanted to create and position the child windows
    for the widgets. However, this call also actually called
    gtk_widget_size_allocate() on the child, which it shouldn't. In some
    cases the overlay is realized before being allocated, and thus it
    will allocate the child at 0x0 which is an invalid size for it to be in.
    In particular, if the child has margins set this will result in negative
    allocations and warnings.
    
    This fix splits out the allocation computation so that
    gtk_overlay_create_child_window can use it without callers
    having to call gtk_overlay_child_allocate() to move the windows.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696623
    785a9162