After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729140 - popovers can't always track the widget
popovers can't always track the widget
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkPopover
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-04-28 19:52 UTC by Carlos Garnacho
Modified: 2014-08-03 16:56 UTC
See Also:
GNOME target: 3.14
GNOME version: ---


Attachments
popover: Track size-allocate on the toplevel (4.44 KB, patch)
2014-04-28 19:53 UTC, Carlos Garnacho
reviewed Details | Review
window: Update popover positions on ::size-allocate (3.11 KB, patch)
2014-08-01 15:49 UTC, Carlos Garnacho
none Details | Review
window: Update popover positions on ::size-allocate (3.72 KB, patch)
2014-08-01 15:53 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-04-28 19:52:57 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)
Comment 1 Carlos Garnacho 2014-04-28 19:53:36 UTC
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.
Comment 2 Matthias Clasen 2014-04-28 20:13:47 UTC
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...
Comment 3 Carlos Garnacho 2014-08-01 15:49:27 UTC
(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.
Comment 4 Carlos Garnacho 2014-08-01 15:49:59 UTC
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.
Comment 5 Carlos Garnacho 2014-08-01 15:53:27 UTC
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.
Comment 6 Matthias Clasen 2014-08-02 21:04:51 UTC
Review of attachment 282279 [details] [review]:

looks good to me
Comment 7 Matthias Clasen 2014-08-03 09:12:40 UTC
doesn't apply cleanly anymore after the other popover fix - could you update it and push ?
Comment 8 Carlos Garnacho 2014-08-03 16:55:38 UTC
Hmm, weird, I'd swear I tackled this one after the other patch at guadec, and I rebased cleanly here, pushing now.
Comment 9 Carlos Garnacho 2014-08-03 16:56:36 UTC
Attachment 282279 [details] pushed as 5b82670 - window: Update popover positions on ::size-allocate