mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 00:11:29 +00:00
wayland: Don't try to guess the popup menu placement when it was set
If a position was already explicitly set, don't try to guess the position of popup menus by looking at the pointer position, just use the set coordinates. https://bugzilla.gnome.org/show_bug.cgi?id=748951
This commit is contained in:
parent
0f47d1bac4
commit
9e464252c0
@ -108,6 +108,7 @@ struct _GdkWindowImplWayland
|
||||
unsigned int use_custom_surface : 1;
|
||||
unsigned int pending_commit : 1;
|
||||
unsigned int awaiting_frame : 1;
|
||||
unsigned int position_set : 1;
|
||||
GdkWindowTypeHint hint;
|
||||
GdkWindow *transient_for;
|
||||
|
||||
@ -1190,10 +1191,13 @@ gdk_wayland_window_map (GdkWindow *window)
|
||||
transient_for = gdk_device_get_window_at_position (impl->grab_device, NULL, NULL);
|
||||
transient_for = gdk_window_get_toplevel (transient_for);
|
||||
|
||||
/* start the popup at the position of the device that holds the grab */
|
||||
gdk_window_get_device_position (transient_for,
|
||||
impl->grab_device,
|
||||
&window->x, &window->y, NULL);
|
||||
/* If the position was not explicitly set, start the popup at the
|
||||
* position of the device that holds the grab.
|
||||
*/
|
||||
if (!impl->position_set)
|
||||
gdk_window_get_device_position (transient_for,
|
||||
impl->grab_device,
|
||||
&window->x, &window->y, NULL);
|
||||
}
|
||||
else
|
||||
transient_for = impl->transient_for;
|
||||
@ -1412,6 +1416,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
|
||||
{
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
impl->position_set = 1;
|
||||
|
||||
if (impl->subsurface)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user