From: Matthias Clasen Date: Tue, 28 Sep 2021 19:47:06 +0000 (-0400) Subject: docs: Mention popovers in the migration guide X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=16c3864e4a1205b23bdad56decd18bdd24a92dce;p=gtk4.git docs: Mention popovers in the migration guide Things have changed around popovers, we should mention that. --- diff --git a/docs/reference/gtk/migrating-3to4.md b/docs/reference/gtk/migrating-3to4.md index 45b007549b..492e8628e4 100644 --- a/docs/reference/gtk/migrating-3to4.md +++ b/docs/reference/gtk/migrating-3to4.md @@ -1332,6 +1332,18 @@ pointer coordinates as inout arguments any more, but as normal in ones. See: [method@Gtk.TreeView.get_tooltip_context], [method@Gtk.IconView.get_tooltip_context] +### Adapt to GtkPopover changes + +In GTK 3, a `GtkPopover` could be attached to any widget, using the `relative-to` +property. This is no longer possible in GTK 4. The parent widget has to be aware +of its popover children, and manage their size allocation. Therefore, only widgets +with dedicated popover support can have them, such as [class@Gtk.MenuButton] or +[class@Gtk.PopoverMenuBar]. + +If you want to make a custom widget that has an attached popover, you need to call +[method@Gtk.Popover.present] in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order +to update the positioning of the popover. + ### Stop using GtkFileChooserButton The `GtkFileChooserButton` widget was removed, due to its shortcomings in