Implement the new dnd/selection protocol
The new protocol splits dnd/selection from wl_shell and allows us to move
the implementation out of shell.c.
diff --git a/compositor/compositor.c b/compositor/compositor.c
index a65a8f9..5bed7ba 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -1457,17 +1457,10 @@
wlsc_surface_activate(struct wlsc_surface *surface,
struct wlsc_input_device *device, uint32_t time)
{
- struct wlsc_shell *shell = surface->compositor->shell;
-
wlsc_surface_raise(surface);
- if (device->selection)
- shell->set_selection_focus(shell,
- device->selection,
- &surface->surface, time);
-
wl_input_device_set_keyboard_focus(&device->input_device,
- &surface->surface,
- time);
+ &surface->surface, time);
+ wlsc_data_device_set_keyboard_focus(device);
}
struct wlsc_binding {
@@ -1719,10 +1712,12 @@
if (time < device->input_device.pointer_focus_time)
return;
+#if 0
if (device->input_device.pointer_focus == NULL)
return;
if (device->input_device.pointer_focus->resource.client != client)
return;
+#endif
if (buffer_resource) {
buffer = buffer_resource->data;
@@ -1762,6 +1757,7 @@
struct wlsc_compositor *ec)
{
wl_input_device_init(&device->input_device);
+ wl_list_init(&device->drag_resource_list);
wl_display_add_global(ec->wl_display, &wl_input_device_interface,
device, bind_input_device);
@@ -1781,6 +1777,7 @@
wl_list_insert(ec->input_device_list.prev, &device->link);
wlsc_input_device_set_pointer_image(device, WLSC_POINTER_LEFT_PTR);
+ device->selection_data_source = NULL;
}
static void
@@ -2102,6 +2099,8 @@
screenshooter_create(ec);
+ wlsc_data_device_manager_init(ec);
+
glActiveTexture(GL_TEXTURE0);
if (wlsc_shader_init(&ec->texture_shader,