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 750372 - gtk_menu_popup gtk_combo_box_menu_position wrong menu_ypos
gtk_menu_popup gtk_combo_box_menu_position wrong menu_ypos
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-06-04 01:24 UTC by Leslie Zhai
Modified: 2017-03-03 14:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
combobox-wrong-menu-ypos.patch (2.66 KB, patch)
2015-06-04 01:24 UTC, Leslie Zhai
none Details | Review

Description Leslie Zhai 2015-06-04 01:24:22 UTC
Created attachment 304563 [details] [review]
combobox-wrong-menu-ypos.patch

Hi Gtk developers,

When I developed application for Magic Linux desktop in 2006, I use PyGtk with Gtk-2.x https://pbs.twimg.com/media/CGeTgcyUIAIvwl5.png there was a GtkComboBox gtk_menu_popup gtk_combo_box_menu_position wrong menu_ypos issue https://pbs.twimg.com/media/CGeTgQUU8AApmpF.png
And when I am developing ***something*** in 2015, there is still such issue, so I try to fix the bug for 10+ years!

I pay more attention to the gtk_combo_box_menu_position, the user supplied function used to position the menu, when pressed the combobox button https://git.gnome.org/browse/gtk+/tree/gtk/gtkcombobox.c?h=gtk-3-16#n2268

I argue that it ignore the relationship between DisplayHeight (use X11 style), GdkEventButton`s y_root and popup menu`s allocation height https://twitter.com/xiangzhai/status/605902462189314048

If DisplayHeight minus y_root is smaller than menu_alloc_height, the menu_ypos should be minus menu_alloc_height too.

But when active_item is bigger than zero, for example, pressed combo popup menu`s item 8,
menu_ypos += active_item * child_allocation.height;

Please pay some attention to the attachment about my patch, thanks a lot!

Regards,
Leslie Zhai
Comment 1 Daniel Boles 2017-03-03 14:33:15 UTC
How popup works has changed with the port to the gtk_menu_popup_at_*() methods. If you find any issues with those, please open a new ticket.