GNOME Bugzilla – Bug 729140
popovers can't always track the widget
Last modified: 2014-08-03 16:56:41 UTC
In testpopover, if the popover is shown and the window resized, the popover never seems to be able to move past the initial window size. Apparently happens due to insufficient gtk_popover_update_position() calls, as the size-allocate call on the button is optimized away. I'm attaching a patch to have popover track toplevel size allocation changes, that'll make this work always, at maybe the expense of some extra operations that could be avoided on some cases (widgets attached to top/left)
Created attachment 275375 [details] [review] popover: Track size-allocate on the toplevel Children may get relocations optimized away if only x/y changed in the GtkAllocation. So keep track of size-allocate on the toplevel itself to make sure the popover is relocated on all situations.
Review of attachment 275375 [details] [review]: would it make more sense to do this on the gtkwindow side, like we already do for map/unmap ? instead of signal connections for each popover, loop over them in the GtkWindow size_allocate implementation...
(In reply to comment #2) > Review of attachment 275375 [details] [review]: > > would it make more sense to do this on the gtkwindow side, like we already do > for map/unmap ? instead of signal connections for each popover, loop over them > in the GtkWindow size_allocate implementation... Right, in the original patch I wanted to avoid some GTK_IS_POPOVER checks (since a "popover" in GtkWindow terms isn't necessarily a GtkPopover, GtkTextHandle uses also that), but looks certainly cleaner than connecting and maintaining a bunch of signal handlers, and wouldn't either be the first check like that in code... I'm attaching an updated patch.
Created attachment 282278 [details] [review] window: Update popover positions on ::size-allocate Popovers may get relocations optimized away if only x/y changed in the GtkAllocation. So make sure the toplevel updates popover positions on all situations.
Created attachment 282279 [details] [review] window: Update popover positions on ::size-allocate Popovers may get relocations optimized away if only x/y changed in the GtkAllocation. So make sure the toplevel updates popover positions on all situations.
Review of attachment 282279 [details] [review]: looks good to me
doesn't apply cleanly anymore after the other popover fix - could you update it and push ?
Hmm, weird, I'd swear I tackled this one after the other patch at guadec, and I rebased cleanly here, pushing now.
Attachment 282279 [details] pushed as 5b82670 - window: Update popover positions on ::size-allocate