コード例 #1
0
ファイル: data-device.c プロジェクト: CSRedRat/wayland
static void
data_device_end_drag_grab(struct wl_seat *seat)
{
	struct wl_resource *surface_resource;
	struct wl_surface_interface *implementation;

	if (seat->drag_surface) {
		surface_resource = &seat->drag_surface->resource;
		implementation = (struct wl_surface_interface *)
			surface_resource->object.implementation;

		implementation->attach(surface_resource->client,
				       surface_resource, NULL, 0, 0);
		wl_list_remove(&seat->drag_icon_listener.link);
	}

	drag_grab_focus(&seat->drag_grab, NULL,
	                wl_fixed_from_int(0), wl_fixed_from_int(0));

	wl_pointer_end_grab(seat->pointer);

	seat->drag_data_source = NULL;
	seat->drag_surface = NULL;
	seat->drag_client = NULL;
}
コード例 #2
0
void ShellSurfaceResizeGrabber::button(wl_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state)
{
    Q_UNUSED(time)
    ShellSurfaceResizeGrabber *self = reinterpret_cast<ShellSurfaceResizeGrabber *>(grab);
    ShellSurface *shell_surface = self->shell_surface;
    if (toQtButton(button) == Qt::LeftButton && !state) {
        wl_pointer_end_grab(grab->pointer);
        shell_surface->resetResizeGrabber();
        delete self;
    }
}
コード例 #3
0
ファイル: data-device.c プロジェクト: anderco/wayland
static void
data_device_end_drag_grab(struct wl_seat *seat)
{
	if (seat->drag_surface) {
		seat->drag_surface = NULL;
		wl_signal_emit(&seat->drag_icon_signal, NULL);
		wl_list_remove(&seat->drag_icon_listener.link);
	}

	drag_grab_focus(&seat->drag_grab, NULL,
	                wl_fixed_from_int(0), wl_fixed_from_int(0));

	wl_pointer_end_grab(seat->pointer);

	seat->drag_data_source = NULL;
	seat->drag_client = NULL;
}