pointer: Split out the code that gets the proper focus surface as well

This commit is contained in:
Jasper St. Pierre 2014-04-18 18:54:35 -04:00
parent 45df3e41c5
commit 020f209c45

View File

@ -352,16 +352,21 @@ count_buttons (const ClutterEvent *event)
return count; return count;
} }
static void static MetaWaylandSurface *
sync_focus_surface (MetaWaylandPointer *pointer) get_focus_surface (MetaWaylandPointer *pointer)
{ {
MetaWaylandSurface *focus_surface;
MetaDisplay *display = meta_get_display (); MetaDisplay *display = meta_get_display ();
if (meta_grab_op_should_block_wayland (display->grab_op)) if (meta_grab_op_should_block_wayland (display->grab_op))
focus_surface = NULL; return NULL;
else
focus_surface = pointer->current; return pointer->current;
}
static void
sync_focus_surface (MetaWaylandPointer *pointer)
{
MetaWaylandSurface *focus_surface = get_focus_surface (pointer);
if (focus_surface != pointer->focus_surface) if (focus_surface != pointer->focus_surface)
{ {