mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 21:34:09 +00:00
wayland-seat: Don't send pointer enter/leave events during a GRAB_OP
meta_wayland_seat_repick() can be called in various cases while mutter has a GRAB_OP ongoing which means we could be sending wrong pointer enter/leave events. https://bugzilla.gnome.org/show_bug.cgi?id=726123
This commit is contained in:
parent
1b29113150
commit
8968501031
@ -583,3 +583,16 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
|
|||||||
*sx = wl_fixed_from_double (xf);
|
*sx = wl_fixed_from_double (xf);
|
||||||
*sy = wl_fixed_from_double (yf);
|
*sy = wl_fixed_from_double (yf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_wayland_pointer_update_current_focus (MetaWaylandPointer *pointer,
|
||||||
|
MetaWaylandSurface *surface)
|
||||||
|
{
|
||||||
|
pointer->current = surface;
|
||||||
|
if (surface != pointer->focus_surface)
|
||||||
|
{
|
||||||
|
const MetaWaylandPointerGrabInterface *interface =
|
||||||
|
pointer->grab->interface;
|
||||||
|
interface->focus (pointer->grab, surface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -94,4 +94,8 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
|
|||||||
wl_fixed_t *x,
|
wl_fixed_t *x,
|
||||||
wl_fixed_t *y);
|
wl_fixed_t *y);
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_wayland_pointer_update_current_focus (MetaWaylandPointer *pointer,
|
||||||
|
MetaWaylandSurface *surface);
|
||||||
|
|
||||||
#endif /* __META_WAYLAND_POINTER_H__ */
|
#endif /* __META_WAYLAND_POINTER_H__ */
|
||||||
|
@ -434,6 +434,13 @@ meta_wayland_seat_repick (MetaWaylandSeat *seat,
|
|||||||
ClutterActor *actor = NULL;
|
ClutterActor *actor = NULL;
|
||||||
MetaWaylandPointer *pointer = &seat->pointer;
|
MetaWaylandPointer *pointer = &seat->pointer;
|
||||||
MetaWaylandSurface *surface = NULL;
|
MetaWaylandSurface *surface = NULL;
|
||||||
|
MetaDisplay *display = meta_get_display ();
|
||||||
|
|
||||||
|
if (display->grab_op != META_GRAB_OP_NONE)
|
||||||
|
{
|
||||||
|
meta_wayland_pointer_update_current_focus (pointer, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (for_event)
|
if (for_event)
|
||||||
{
|
{
|
||||||
@ -456,13 +463,7 @@ meta_wayland_seat_repick (MetaWaylandSeat *seat,
|
|||||||
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
|
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
|
||||||
surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
|
surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
|
||||||
|
|
||||||
pointer->current = surface;
|
meta_wayland_pointer_update_current_focus (pointer, surface);
|
||||||
if (surface != pointer->focus_surface)
|
|
||||||
{
|
|
||||||
const MetaWaylandPointerGrabInterface *interface =
|
|
||||||
pointer->grab->interface;
|
|
||||||
interface->focus (pointer->grab, surface);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user