pointer: Merge update_current_focus and repick_for_event

In order to correctly fix the issue to make sure we only set the
focused surface to NULL during a grab, but not the current surface,
we need to merge update_current_surface back into repick_for_event
so we have more control over the behavior here.
This commit is contained in:
Jasper St. Pierre 2014-04-18 18:38:20 -04:00
parent de7a644656
commit d68da0b8cf

View File

@ -352,22 +352,6 @@ count_buttons (const ClutterEvent *event)
return count; return count;
} }
static void
update_current_focus (MetaWaylandPointer *pointer,
MetaWaylandSurface *surface)
{
pointer->current = surface;
if (pointer->cursor_tracker && surface == NULL)
meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
if (surface != pointer->focus_surface)
{
const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
interface->focus (pointer->grab, surface);
}
}
static void static void
repick_for_event (MetaWaylandPointer *pointer, repick_for_event (MetaWaylandPointer *pointer,
const ClutterEvent *for_event) const ClutterEvent *for_event)
@ -376,12 +360,6 @@ repick_for_event (MetaWaylandPointer *pointer,
MetaWaylandSurface *surface = NULL; MetaWaylandSurface *surface = NULL;
MetaDisplay *display = meta_get_display (); MetaDisplay *display = meta_get_display ();
if (meta_grab_op_should_block_wayland (display->grab_op))
{
update_current_focus (pointer, NULL);
return;
}
if (for_event) if (for_event)
{ {
actor = clutter_event_get_source (for_event); actor = clutter_event_get_source (for_event);
@ -403,7 +381,19 @@ repick_for_event (MetaWaylandPointer *pointer,
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));
update_current_focus (pointer, surface); if (meta_grab_op_should_block_wayland (display->grab_op))
surface = NULL;
pointer->current = surface;
if (pointer->cursor_tracker && surface == NULL)
meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
if (surface != pointer->focus_surface)
{
const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
interface->focus (pointer->grab, surface);
}
} }
static void static void