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 420360 - Displaying stock icon causes scrolled windows to expand
Displaying stock icon causes scrolled windows to expand
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2007-03-20 00:57 UTC by Grahame Bowland
Modified: 2018-02-10 03:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Perl script and glade file showing problem. (2.18 KB, application/x-gzip)
2007-03-20 00:59 UTC, Grahame Bowland
Details
Quick C port of original perl script (1.83 KB, text/plain)
2007-03-20 02:07 UTC, muppet
Details
What the window looks like before a stock icon is shown. (11.98 KB, image/png)
2007-03-20 03:42 UTC, Grahame Bowland
Details
The window after I've opened the file menu; all the scrolled windows have expanded. (57.18 KB, image/png)
2007-03-20 03:43 UTC, Grahame Bowland
Details

Description Grahame Bowland 2007-03-20 00:57:38 UTC
I'll attach the source code, but here's a description. I've got three scrolled windows with viewports, and a large number of buttons packed into each. Whenever I display a stock icon (it may be any icon) the main window resizes to the size of the maximum scrolled window contents (eg. the scrolled windows effectively stop doing anything.)

I've reduced it down to an example script which shows the problem, I'll attach it in a moment. To replicate using the attached script, run it and you should see two scrolled areas with a bunch of widgets packed in them. They should be limited to the available area in the window, and the rest of their contents cut off - this makes sense, as they are packed into scrolled windows with the bars cut off.

On Fedora Core 6, with Gtk-Perl: perl-Gtk2-1.144-1.fc6 and  perl-Gtk2-GladeXML-1.006-1.fc6 the following results:
  * click on the view menu. nothing changes (except view menu appears)
  * click on the file menu. main window resizes to display the entire contents of each scrolled area.
I've tracked this down to the stock icon on the Quit entry; if you change that, the problem vanishes.

The same script works fine (no strange resize) on a Fedora Core 4 machine with Gtk 2.6 and the corresponding perl-gtk2.

Thanks!
Comment 1 Grahame Bowland 2007-03-20 00:59:11 UTC
Created attachment 84927 [details]
Perl script and glade file showing problem.

Just run ./test.pl with test.glade in the same directory.
Comment 2 muppet 2007-03-20 02:04:38 UTC
It is highly unlikely that the bindings would cause this sort of behavior.

I made a quick port of your perl script to C, using libglade and gtk+ directly.  The port omits several lines of your original, which were unused (you didn't use strict!), so please double-check the code for sanity.

My system is rather old, and doesn't exhibit any of the behavior you describe.  Please try this C port, and if it still exhibits the bug behavior, reassign to to gtk+.

(attachment in next comment)
Comment 3 muppet 2007-03-20 02:07:17 UTC
Created attachment 84930 [details]
Quick C port of original perl script

compile with

   gcc -o test test.c `pkg-config libglade-2.0 --cflags --libs`
Comment 4 Grahame Bowland 2007-03-20 03:41:44 UTC
Thanks for writing the C test case! I see the same behaviour in the C version, so I'll reassign this under Gtk+. I'll upload a couple of screenshots of the problem behaviour as well; I get this behaviour both with the stock gtk2-2.10.8-1.fc6 and with Gtk 2.10.9 compiled from source.
Comment 5 Grahame Bowland 2007-03-20 03:42:57 UTC
Created attachment 84932 [details]
What the window looks like before a stock icon is shown.
Comment 6 Grahame Bowland 2007-03-20 03:43:50 UTC
Created attachment 84933 [details]
The window after I've opened the file menu; all the scrolled windows have expanded.
Comment 7 Matthias Clasen 2007-03-20 16:53:37 UTC
Doesn't happen here with 2.10.11. Can you still reproduce with the latest 2.10.x releases ?
Comment 8 Grahame Bowland 2007-03-21 02:43:28 UTC
Aha, it occurs in 2.10.9 but not in gtk 2.10.10; I've built everything from libpng upwards to negate any Fedora patches being the problem. Anyway, it's fixed in 2.10.10 - not sure what the fix was, I'll see if I can find it, backport it and put it in the Fedora bugzilla.

Thanks!
Comment 9 Matthias Clasen 2007-03-21 03:06:36 UTC
That would be greatly appreciated.
Comment 10 Grahame Bowland 2007-03-21 03:12:41 UTC
The patch for #414875 seems to fix the problem.

If you happen to have the File menu of the test program open when a style reset happens, might the problem still occur? I'm not quite sure how to trigger a style reset in that circumstance to check. (I'd have to have gnome-theme-manager focussed, in which case the menu wouldn't be visible.)

Comment 11 Matthias Clasen 2007-03-21 03:25:15 UTC
One way to change the theme without focusing the theme manager is to use something like 

sleep 10; gconftool-2 --set /desktop/gnome/interface/theme ...

(I always forget the exact syntax of gconftool-2, but you get the idea)
Comment 12 Grahame Bowland 2007-03-21 03:53:42 UTC
Ah, thanks.

I can now reproduce the bug with Gtk 2.10.10, it's a bit obscure but still probably worth fixing.

1) run ./test
2) in a terminal:
sleep 10;gconftool-2 --type String --set /desktop/gnome/interface/icon_theme Tango
(change Tango to any icon theme you have, but which is not the current icon theme)
3) within ten seconds, open the File menu in test and leave it open

For me the window expands when the icon theme changes.
Comment 13 Matthias Clasen 2018-02-10 03:30:49 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.