GNOME Bugzilla – Bug 119821
Option menu scrolling broken
Last modified: 2004-12-22 21:47:04 UTC
The scrolling of option menus at the edge of the screen no longer works ... the option menu simply comes up scrolled fully into the area. This apparently broke with: Sat Dec 14 14:19:16 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenu.c: Add a new binding signal, "move_scroll", and use it to hook up Home/End/Page_Up/Page_Down keybindings. (#80484, Narayana Pattipati, Marius Andreiana) Which added: offset = CLAMP (offset, 0, menu_height - view_height); To gtk_menu_scroll_to(). (The idea was to keep people from keynaving past the ends of the scroll with PageUp/PageDown, if I recall, so any fix needs to be tested for this.)
Created attachment 19396 [details] [review] proposed patch
- menu->upper_arrow_visible = (view_height < menu_height && offset > 0); + menu->upper_arrow_visible = (view_height <= menu_height && offset > 0); [...] - menu->lower_arrow_visible = (view_height < menu_height && offset < menu_height - view_height); + menu->lower_arrow_visible = (view_height <= menu_height && offset < menu_height - view_height); For these changes, I think it might more sense to simply remove the first part of the conditional - I don't think it makes sense as modified. + new_offset = menu->scroll_offset + step; + new_offset -= page_size - (get_menu_height (menu) - new_offset); new_offset = new_offset - (page_size - get_menu_height() + new_offset) The second line is mathematically equivalent to: new_offset = get_menu_height (menu) - page_size; so, I don't think it can be right. I'd expect something like the old: offset = CLAMP (offset, 0, menu_height - view_height);
Created attachment 19419 [details] [review] updated and tested patch
Looks good to commit.
Committed on gtk-2-2 and HEAD.
this kinda sounds like the issue I am having with gtk 2.2.4 and gtk 2. 3.4. Not sure though. If I am wrong, please close bug again I attach a screenshot and a test program triggering the problem
Created attachment 24428 [details] Screenshot. Note how the background of the popup menu is big, although the entries are all put on the bottom, none at the top.
Created attachment 24429 [details] Test Program that shows this behaviour in gtk 2.2.4 and gtk 2.3.2
No, thats intended behavior. The option menu initially scrolls so that the selected item is under the mouse.