Exemplo n.º 1
0
static void
weston_desktop_seat_popup_grab_end(struct weston_desktop_seat *seat)
{
	struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat->seat);
	struct weston_pointer *pointer = weston_seat_get_pointer(seat->seat);
	struct weston_touch *touch = weston_seat_get_touch(seat->seat);

	while (!wl_list_empty(&seat->popup_grab.surfaces)) {
		struct wl_list *link = seat->popup_grab.surfaces.prev;
		struct weston_desktop_surface *surface =
			weston_desktop_surface_from_grab_link(link);

		wl_list_remove(link);
		wl_list_init(link);
		weston_desktop_surface_popup_dismiss(surface);
	}

	if (keyboard != NULL &&
	    keyboard->grab->interface == &weston_desktop_seat_keyboard_popup_grab_interface)
		weston_keyboard_end_grab(keyboard);

	if (pointer != NULL &&
	    pointer->grab->interface == &weston_desktop_seat_pointer_popup_grab_interface)
		weston_pointer_end_grab(pointer);

	if (touch != NULL &&
	    touch->grab->interface == &weston_desktop_seat_touch_popup_grab_interface)
		weston_touch_end_grab(touch);

	seat->popup_grab.client = NULL;
}
Exemplo n.º 2
0
static void
data_device_end_touch_drag_grab(struct weston_touch_drag *drag)
{
	struct weston_touch *touch = drag->grab.touch;

	data_device_end_drag_grab(&drag->base, touch->seat);
	weston_touch_end_grab(touch);
	free(drag);
}