mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-15 06:59:49 -05:00
Make wlsc_input_device_update_grab() take a grab object
This commit is contained in:
parent
287343a0d3
commit
57db067cec
1 changed files with 6 additions and 9 deletions
|
|
@ -530,7 +530,7 @@ wlsc_input_device_start_grab(struct wlsc_input_device *device,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
wlsc_input_device_update_grab(struct wlsc_input_device *device,
|
wlsc_input_device_update_grab(struct wlsc_input_device *device,
|
||||||
enum wlsc_grab_type grab,
|
struct wl_grab *grab,
|
||||||
struct wl_surface *surface, uint32_t time)
|
struct wl_surface *surface, uint32_t time)
|
||||||
{
|
{
|
||||||
if (device->grab != WLSC_DEVICE_GRAB_MOTION ||
|
if (device->grab != WLSC_DEVICE_GRAB_MOTION ||
|
||||||
|
|
@ -538,7 +538,7 @@ wlsc_input_device_update_grab(struct wlsc_input_device *device,
|
||||||
device->input_device.pointer_focus != surface)
|
device->input_device.pointer_focus != surface)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
device->grab = grab;
|
device->grab_object = grab;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -601,8 +601,7 @@ shell_move(struct wl_client *client, struct wl_shell *shell,
|
||||||
move->dx = es->x - wd->grab_x;
|
move->dx = es->x - wd->grab_x;
|
||||||
move->dy = es->y - wd->grab_y;
|
move->dy = es->y - wd->grab_y;
|
||||||
|
|
||||||
if (wlsc_input_device_update_grab(wd, WLSC_DEVICE_GRAB_MOVE,
|
if (wlsc_input_device_update_grab(wd, &move->grab, surface, time) < 0)
|
||||||
surface, time) < 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wlsc_input_device_set_pointer_image(wd, WLSC_POINTER_DRAGGING);
|
wlsc_input_device_set_pointer_image(wd, WLSC_POINTER_DRAGGING);
|
||||||
|
|
@ -720,11 +719,10 @@ shell_resize(struct wl_client *client, struct wl_shell *shell,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wlsc_input_device_update_grab(wd, edges, surface, time) < 0)
|
if (wlsc_input_device_update_grab(wd, &resize->grab, surface, time) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wlsc_input_device_set_pointer_image(wd, pointer);
|
wlsc_input_device_set_pointer_image(wd, pointer);
|
||||||
wd->grab_object = &resize->grab;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -1231,11 +1229,10 @@ drag_activate(struct wl_client *client,
|
||||||
struct wlsc_surface *target;
|
struct wlsc_surface *target;
|
||||||
int32_t sx, sy;
|
int32_t sx, sy;
|
||||||
|
|
||||||
if (wlsc_input_device_update_grab(device, WLSC_DEVICE_GRAB_DRAG,
|
if (wlsc_input_device_update_grab(device,
|
||||||
surface, time) < 0)
|
&drag->grab, surface, time) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
device->grab_object = &drag->grab;
|
|
||||||
drag->grab.interface = &drag_grab_interface;
|
drag->grab.interface = &drag_grab_interface;
|
||||||
drag->grab.input_device = input_device;
|
drag->grab.input_device = input_device;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue