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 119821 - Option menu scrolling broken
Option menu scrolling broken
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-08-13 21:11 UTC by Owen Taylor
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.64 KB, patch)
2003-08-20 21:54 UTC, Kristian Rietveld
none Details | Review
updated and tested patch (2.58 KB, patch)
2003-08-21 18:50 UTC, Kristian Rietveld
none Details | Review
Screenshot. Note how the background of the popup menu is big, although the entries are all put on the bottom, none at the top. (38.97 KB, image/png)
2004-02-15 20:15 UTC, danny.milo
  Details
Test Program that shows this behaviour in gtk 2.2.4 and gtk 2.3.2 (674 bytes, text/plain)
2004-02-15 20:16 UTC, danny.milo
  Details

Description Owen Taylor 2003-08-13 21:11:57 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.)
Comment 1 Kristian Rietveld 2003-08-20 21:54:37 UTC
Created attachment 19396 [details] [review]
proposed patch
Comment 2 Owen Taylor 2003-08-21 16:27:27 UTC
-      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);
Comment 3 Kristian Rietveld 2003-08-21 18:50:50 UTC
Created attachment 19419 [details] [review]
updated and tested patch
Comment 4 Owen Taylor 2003-08-21 19:07:56 UTC
Looks good to commit.
Comment 5 Kristian Rietveld 2003-08-21 19:43:58 UTC
Committed on gtk-2-2 and HEAD.
Comment 6 danny.milo 2004-02-15 20:14:22 UTC
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
Comment 7 danny.milo 2004-02-15 20:15:50 UTC
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.
Comment 8 danny.milo 2004-02-15 20:16:29 UTC
Created attachment 24429 [details]
Test Program that shows this behaviour in gtk 2.2.4 and gtk 2.3.2
Comment 9 Matthias Clasen 2004-02-16 08:24:21 UTC
No, thats intended behavior. The option menu initially scrolls so that 
the selected item is under the mouse.