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:
Jonas Ådahl 2015-06-05 13:35:21 +08:00
parent 0f47d1bac4
commit 9e464252c0

View File

@ -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)
{