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 658928 - Can't use child of a GtkScrolledWindow as a geometry widget
Can't use child of a GtkScrolledWindow as a geometry widget
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-09-13 14:53 UTC by Tony Houghton
Modified: 2018-02-10 04:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Python program to demonstrate this bug (1.20 KB, text/x-python)
2011-09-13 14:53 UTC, Tony Houghton
Details

Description Tony Houghton 2011-09-13 14:53:52 UTC
Created attachment 196387 [details]
Python program to demonstrate this bug

gtk_window_set_geometry_hints doesn't work correctly if the geometry widget is the child of a GtkScrolledWindow. I've written a test program to demonstrate it. It appears that GTK tries to apply the geometry but fails to take into account the scrollbar etc. I get a stream of warnings:

Gtk-WARNING **: Toplevel size doesn't seem to directly depend on the size of the geometry widget from gtk_window_set_geometry_hints(). The geometry widget might not be in the window, or it might not be packed into the window appropriately

Certain events, eg entering enough text to cause the horizontal scrollbar to appear, cause the program to go into an infinite loop, generating these messages without responding to further events.

This might be related to Bug 649680 but this one happens regardless of window manager and I think it's a separate issue.
Comment 1 Tony Houghton 2012-10-05 16:08:47 UTC
I've had a look at gtk's code and added a bit of logging and found something I think is significant. The problem is where gtk_window_compute_hints() tries to work out how much extra space there is between the geometry widget and the top-level window. It calls _gtk_widget_override_size_request() with a width and height of 10000 before reading the size difference between the two widgets, but the trouble appears to be that the GtkScrolledWindow "absorbs" the size change, leaving the top-level unchanged, so it gets large negative values for extra_width and extra_height. 

I don't know how this can be fixed, but also significant is that programs like roxterm and gnome-terminal aren't affected by this, but they also use geometry widgets in scrolled windows. Perhaps it's because they also use GtkNotebook?
Comment 2 Christian Persch 2012-10-05 16:14:19 UTC
Actually gnome-terminal doesn't use a GtkScrolledWindow as container for the VteTerminal, but just a hbox containing the VteTerminal and a GtkScrollbar.
Comment 3 Tony Houghton 2012-10-05 16:33:11 UTC
OK, roxterm probably does the same - I should have known, being the author! So at least there appears to be a workaround to avoid this problem.

It isn't anything to do with the GtkNotebook, because in the meantime I've added one to my python test program and I still got the warnings.
Comment 4 Tony Houghton 2012-10-06 17:11:22 UTC
I thought about rewriting my GtkSourceView-based text editor without GtkScrolledWindow, but it looks like it would be non-trivial at best.

So I would really like this fixed, but it looks like it would be a big job :-(.
Comment 5 Matthias Clasen 2018-02-10 04:36:00 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.