Move code around to keep input device interface and init function close
This commit is contained in:
+30
-31
@@ -1064,37 +1064,6 @@ notify_key(struct wl_input_device *device,
|
|||||||
WL_INPUT_DEVICE_KEY, time, key, state);
|
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
|
static void
|
||||||
wl_drag_set_pointer_focus(struct wl_drag *drag,
|
wl_drag_set_pointer_focus(struct wl_drag *drag,
|
||||||
struct wl_surface *surface, uint32_t time,
|
struct wl_surface *surface, uint32_t time,
|
||||||
@@ -1291,6 +1260,36 @@ static const struct wl_drag_interface drag_interface = {
|
|||||||
drag_destroy,
|
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
|
void
|
||||||
wlsc_input_device_init(struct wlsc_input_device *device,
|
wlsc_input_device_init(struct wlsc_input_device *device,
|
||||||
struct wlsc_compositor *ec)
|
struct wlsc_compositor *ec)
|
||||||
|
|||||||
Reference in New Issue
Block a user