static int
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)
{
if (device->grab != WLSC_DEVICE_GRAB_MOTION ||
device->input_device.pointer_focus != surface)
return -1;
- device->grab = grab;
+ device->grab_object = grab;
return 0;
}
move->dx = es->x - wd->grab_x;
move->dy = es->y - wd->grab_y;
- if (wlsc_input_device_update_grab(wd, WLSC_DEVICE_GRAB_MOVE,
- surface, time) < 0)
+ if (wlsc_input_device_update_grab(wd, &move->grab, surface, time) < 0)
return;
wlsc_input_device_set_pointer_image(wd, WLSC_POINTER_DRAGGING);
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;
wlsc_input_device_set_pointer_image(wd, pointer);
- wd->grab_object = &resize->grab;
}
static void
struct wlsc_surface *target;
int32_t sx, sy;
- if (wlsc_input_device_update_grab(device, WLSC_DEVICE_GRAB_DRAG,
- surface, time) < 0)
+ if (wlsc_input_device_update_grab(device,
+ &drag->grab, surface, time) < 0)
return;
- device->grab_object = &drag->grab;
drag->grab.interface = &drag_grab_interface;
drag->grab.input_device = input_device;