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 728228 - GtkPopover: problems with size request
GtkPopover: problems with size request
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkPopover
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 725622
 
 
Reported: 2014-04-15 00:20 UTC by Cosimo Cecchi
Modified: 2017-08-31 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (1.87 KB, application/javascript)
2014-04-15 00:21 UTC, Cosimo Cecchi
  Details
treeview: Queue resizes on row validation (847 bytes, patch)
2014-07-31 08:51 UTC, Carlos Garnacho
none Details | Review
Screencast (176.68 KB, video/webm)
2015-04-08 16:15 UTC, Trinh Anh Ngoc
  Details

Description Cosimo Cecchi 2014-04-15 00:20:57 UTC
While reviewing bug 725622 - which ports Documents' dropdown widget to GtkPopover - I was confused by the need to set a height request on the popover child.

I dug more into the issue, and it seems that in some cases the popover will fail to size itself properly to the child. This doesn't seem the case for children of GtkRevealer, which is the code that Document previously used.

Please see the attached reduced testcase - the same GtkTreeView is packed into a GtkPopover and a GtkRevealer. The resulting size request works well for the revealer case, but not for the popover.
Comment 1 Cosimo Cecchi 2014-04-15 00:21:37 UTC
Created attachment 274322 [details]
testcase

Test case. Run it with 'gjs testpopover.js'.
Comment 2 Matthias Clasen 2014-04-15 05:38:02 UTC
Carlos, can you have a look at this ?
Comment 3 Carlos Garnacho 2014-07-31 08:50:33 UTC
From what I could see, GtkTreeView is updating adjustment boundaries on the idle row validation, but is not queueing resizes, which makes popover stick to the pre-validation widget size.

Now the question is whether we badly require treeviews to be children of scrolledwindows or not, I'm attaching a patch for the second case, although it'll definitely involve extra operations for the most normal usecases.
Comment 4 Carlos Garnacho 2014-07-31 08:51:43 UTC
Created attachment 282126 [details] [review]
treeview: Queue resizes on row validation

This is somewhat confusing if the treeview is embedded with no
scrolledwindow in a non-expandable location in the window, since
it will stick to the minimum, pre-validation size.
Comment 5 Matthias Clasen 2015-03-07 22:01:52 UTC
Do we still want this ?
Comment 6 Trinh Anh Ngoc 2015-04-08 16:15:06 UTC
Created attachment 301151 [details]
Screencast

I am developing a dictionary app that use popover to show list of matched words. I attached a screencast to describe about this bug in my app.
Comment 7 Trinh Anh Ngoc 2015-04-08 16:25:49 UTC
Sorry, i seem to misunderstand the problem. Btw, why do treeview can not auto scroll to selected row?
Comment 8 Trinh Anh Ngoc 2015-04-08 16:52:21 UTC
Sorry again, i found the problem in my codes :(
Comment 9 Daniel Boles 2017-08-31 19:04:26 UTC
This seems not to be an issue anymore; here, the Popover gets the right size for the TreeView (once I make the window large enough for it).