void ShellGrab::end() { if (m_pointer) { weston_pointer_end_grab(m_pointer); m_pointer = nullptr; } }
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; }
ShellSeat::~ShellSeat() { if (m_popupGrab.client) { weston_pointer_end_grab(m_popupGrab.grab.pointer); } wl_list_remove(&m_listeners.seatDestroy.link); wl_list_remove(&m_listeners.focus.link); }
void ShellSeat::removePopupGrab(ShellSurface *surface) { m_popupGrab.surfaces.remove(surface); if (m_popupGrab.surfaces.empty()) { weston_pointer_end_grab(m_popupGrab.grab.pointer); m_popupGrab.client = nullptr; } }
static void data_device_end_pointer_drag_grab(struct weston_pointer_drag *drag) { struct weston_pointer *pointer = drag->grab.pointer; data_device_end_drag_grab(&drag->base, pointer->seat); weston_pointer_end_grab(pointer); free(drag); }
void ShellSeat::endPopupGrab() { struct weston_pointer *pointer = m_popupGrab.grab.pointer; if (m_popupGrab.client) { weston_pointer_end_grab(pointer->grab->pointer); m_popupGrab.client = nullptr; /* Send the popup_done event to all the popups open */ for (ShellSurface *shsurf: m_popupGrab.surfaces) { shsurf->popupDone(); } m_popupGrab.surfaces.clear(); } }