void ShellGrab::unsetCursor() { wl_fixed_t sx, sy; weston_view *view = weston_compositor_pick_view(pointer()->seat->compositor, pointer()->x, pointer()->y, &sx, &sy); if (pointer()->focus != view) { weston_pointer_set_focus(pointer(), view, sx, sy); } }
static void drag_grab_touch_focus(struct weston_touch_drag *drag) { struct weston_touch *touch = drag->grab.touch; struct weston_view *view; wl_fixed_t view_x, view_y; view = weston_compositor_pick_view(touch->seat->compositor, touch->grab_x, touch->grab_y, &view_x, &view_y); if (drag->base.focus != view) weston_drag_set_focus(&drag->base, touch->seat, view, view_x, view_y); }
static void drag_grab_focus(struct weston_pointer_grab *grab) { struct weston_pointer_drag *drag = container_of(grab, struct weston_pointer_drag, grab); struct weston_pointer *pointer = grab->pointer; struct weston_view *view; wl_fixed_t sx, sy; view = weston_compositor_pick_view(pointer->seat->compositor, pointer->x, pointer->y, &sx, &sy); if (drag->base.focus != view) weston_drag_set_focus(&drag->base, pointer->seat, view, sx, sy); }
void Shell::defaultPointerGrabFocus(weston_pointer_grab *grab) { weston_pointer *pointer = grab->pointer; if (pointer->button_count > 0) { return; } wl_fixed_t sx, sy; weston_view *view = weston_compositor_pick_view(pointer->seat->compositor, pointer->x, pointer->y, &sx, &sy); if (view && view->surface->configure == &black_surface_configure) { view = static_cast<ShellSurface *>(view->surface->configure_private)->view(); } if (pointer->focus != view) { weston_pointer_set_focus(pointer, view, sx, sy); } }
static void weston_desktop_seat_popup_grab_pointer_focus(struct weston_pointer_grab *grab) { struct weston_desktop_seat *seat = wl_container_of(grab, seat, popup_grab.pointer); struct weston_pointer *pointer = grab->pointer; struct weston_view *view; wl_fixed_t sx, sy; view = weston_compositor_pick_view(pointer->seat->compositor, pointer->x, pointer->y, &sx, &sy); if (view != NULL && view->surface->resource != NULL && wl_resource_get_client(view->surface->resource) == seat->popup_grab.client) weston_pointer_set_focus(pointer, view, sx, sy); else weston_pointer_clear_focus(pointer); }