GNOME Bugzilla – Bug 84955
Gtkcombo popup window wrong size
Last modified: 2011-02-04 16:10:07 UTC
When the horizontal scrollbar is showed in a combo box popup window, it's sized incorrectly. (as result also vertical scrollbar is showed when not necessary). The bug is in the gtk_combo_get_pos function. We are getting the scrollbar_spacing in this way: GTK_SCROLLED_WINDOW_GET_CLASS (combo->popup)->scrollbar_spacing and ignoring that the value could be negative. The SCROLLBAR_SPACING(w) macro defined in gtkscrolledwindow.c in case of negatives values is falling back to DEFAULT_SCROLLBAR_SPACING. Using that macro would probably fix the problem, at least it fixed it in some code I stealed from gtkcombo ;) But the macro is private...
Created attachment 9179 [details] [review] Patch fixing scrollbar issue, but not fixing the problem
Just fixing the scrollbar issue doesn't seem to make the vscrollbar go away. (Trying with the entry test in testgtk, removing some items to make sure that the vertical height was less than the maximum of 400 pixels.) Maybe there is some theme issue or something involved...looks like it needs more investigation.
Created attachment 9180 [details] [review] patch fixing the problem
This works but dont ask me why ;) I tried it with testgtk and galeon and the issue seem fixed. I have vim configured with a different code style, so spaces/tabs could be messed up. I'm sorry to not have time to look at it now :(
Your change looks right to me. (The reason it is needed is that we pop up the popup before we've ever size requested the scrollbars) I've applied a fix now that is pretty much equivalent except that I called size_request() on the vscrollbar as well, and I added _gtk_scrolled_window_get_scrollbar_spacing. Thanks, and sorry for the delay. Thu Oct 10 14:35:31 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkscrolledwindow.[ch]: Privately export _gtk_scrolled_window_get_scrollbar_spacing(). * gtk/gtkcombo.c: Properly account from scrollbar spacing when computing the size of the popup window. (#84955, Marco Pesenti Gritti)