Skip to content

Add some stubs for newer protocol bits in the data manager, claiming support for protocol version 3. #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions libswc/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,25 @@ offer_receive(struct wl_client *client, struct wl_resource *offer, const char *m
close(fd);
}

static void
offer_finish(struct wl_client *client, struct wl_resource *offer)
{
/* XXX: Implement */
}

static void
offer_set_actions(struct wl_client *client, struct wl_resource *offer,
uint32_t dnd_actions, uint32_t preferred_action)
{
/* XXX: Implement */
}

static const struct wl_data_offer_interface data_offer_impl = {
.accept = offer_accept,
.receive = offer_receive,
.destroy = destroy_resource,
.finish = offer_finish,
.set_actions = offer_set_actions,
};

static void
Expand Down
1 change: 1 addition & 0 deletions libswc/data_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ set_selection(struct wl_client *client, struct wl_resource *resource, struct wl_
static const struct wl_data_device_interface data_device_impl = {
.start_drag = start_drag,
.set_selection = set_selection,
.release = destroy_resource
};

static void
Expand Down
6 changes: 3 additions & 3 deletions libswc/data_device_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ bind_data_device_manager(struct wl_client *client, void *data, uint32_t version,
{
struct wl_resource *resource;

if (version > 1)
version = 1;
if (version > 3)
version = 3;

resource = wl_resource_create(client, &wl_data_device_manager_interface, version, id);
wl_resource_set_implementation(resource, &data_device_manager_impl, NULL, NULL);
Expand All @@ -66,5 +66,5 @@ bind_data_device_manager(struct wl_client *client, void *data, uint32_t version,
struct wl_global *
data_device_manager_create(struct wl_display *display)
{
return wl_global_create(display, &wl_data_device_manager_interface, 1, NULL, &bind_data_device_manager);
return wl_global_create(display, &wl_data_device_manager_interface, 3, NULL, &bind_data_device_manager);
}