Commit ab1862d6 authored by Kristian Høgsberg's avatar Kristian Høgsberg
Browse files

Move code around to keep input device interface and init function close

parent 67f367f3
......@@ -1064,37 +1064,6 @@ notify_key(struct wl_input_device *device,
WL_INPUT_DEVICE_KEY, time, key, state);
}
static void
input_device_attach(struct wl_client *client,
struct wl_input_device *device_base,
uint32_t time,
struct wl_buffer *buffer, int32_t x, int32_t y)
{
struct wlsc_input_device *device =
(struct wlsc_input_device *) device_base;
if (time < device->input_device.pointer_focus_time)
return;
if (device->input_device.pointer_focus == NULL)
return;
if (device->input_device.pointer_focus->client != client)
return;
if (buffer == NULL) {
wlsc_input_device_set_pointer_image(device,
WLSC_POINTER_LEFT_PTR);
return;
}
wlsc_input_device_attach(device, buffer, x, y);
}
const static struct wl_input_device_interface input_device_interface = {
input_device_attach,
};
static void
wl_drag_set_pointer_focus(struct wl_drag *drag,
struct wl_surface *surface, uint32_t time,
......@@ -1291,6 +1260,36 @@ static const struct wl_drag_interface drag_interface = {
drag_destroy,
};
static void
input_device_attach(struct wl_client *client,
struct wl_input_device *device_base,
uint32_t time,
struct wl_buffer *buffer, int32_t x, int32_t y)
{
struct wlsc_input_device *device =
(struct wlsc_input_device *) device_base;
if (time < device->input_device.pointer_focus_time)
return;
if (device->input_device.pointer_focus == NULL)
return;
if (device->input_device.pointer_focus->client != client)
return;
if (buffer == NULL) {
wlsc_input_device_set_pointer_image(device,
WLSC_POINTER_LEFT_PTR);
return;
}
wlsc_input_device_attach(device, buffer, x, y);
}
const static struct wl_input_device_interface input_device_interface = {
input_device_attach,
};
void
wlsc_input_device_init(struct wlsc_input_device *device,
struct wlsc_compositor *ec)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment