GNOME Bugzilla – Bug 772922
GtkMenu: Try using gdk_window_move_to_rect() more often
Last modified: 2016-10-21 15:55:28 UTC
In order to make unchanged applications behave better on platforms where the legacy menu position constraining code often failed badly (e.g. Wayland), let the GtkMenu positioning code attempt to use gdk_window_move_to_rect() more often than before.
Created attachment 337692 [details] [review] GtkMenu: Try using gdk_window_move_to_rect() more often With best-effort, try to use gdk_window_move_to_rect() more often, when all pieces fit together. For the non-legacy paths to be triggered for when gtk_menu_popup_for_device() or gtk_menu_popup() were used, the following conditions must be met: 1) There is no custom positioning function specified 2) The menu is attached to a widget (using gtk_menu_attach_to_widget()) 3) There is a associated grab device
Review of attachment 337692 [details] [review]: sounds good to me
Review of attachment 337692 [details] [review]: ::: gtk/gtkmenu.c @@ +5184,3 @@ + attach_widget = gtk_menu_get_attach_widget (menu); + + * One of the legacy gtk_menu_popup*() functions were used to popup but This condition looks wrong. Shouldn't it be: if (grab_device && attach_widget) ?
Review of attachment 337692 [details] [review]: ::: gtk/gtkmenu.c @@ +5184,3 @@ + attach_widget = gtk_menu_get_attach_widget (menu); + + if (attach_widget && attach_widget) Ehe, indeed.
Created attachment 337730 [details] [review] GtkMenu: Try using gdk_window_move_to_rect() more often With best-effort, try to use gdk_window_move_to_rect() more often, when all pieces fit together. For the non-legacy paths to be triggered for when gtk_menu_popup_for_device() or gtk_menu_popup() were used, the following conditions must be met: 1) There is no custom positioning function specified 2) The menu is attached to a widget (using gtk_menu_attach_to_widget()) 3) There is a associated grab device
Review of attachment 337730 [details] [review]: ok
Attachment 337730 [details] pushed as 11b5cfb - GtkMenu: Try using gdk_window_move_to_rect() more often