GNOME Bugzilla – Bug 750372
gtk_menu_popup gtk_combo_box_menu_position wrong menu_ypos
Last modified: 2017-03-03 14:33:15 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
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.