summaryrefslogtreecommitdiff
path: root/src/platform/wayland/drag.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/wayland/drag.c')
-rw-r--r--src/platform/wayland/drag.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/platform/wayland/drag.c b/src/platform/wayland/drag.c
index 989dbb6..2cfd432 100644
--- a/src/platform/wayland/drag.c
+++ b/src/platform/wayland/drag.c
@@ -139,7 +139,7 @@ static const struct wl_data_source_listener source_listener = {
static struct seat *drag_seat(struct wayland_display *c, struct wayland_surface *origin)
{
struct wayland_surface *root = surface_root(origin);
- struct seat *active = conn_active_seat(c);
+ struct seat *active = c->active_seat ? c->active_seat : c->seats;
if (active && active->press_serial &&
surface_root(active->press_surface) == root)
return active;
@@ -225,7 +225,9 @@ static struct yasl_vector2i drag_device_pos(const struct wayland_surface *w, dou
void conn_drop_target(struct wayland_display *c, enum yasl_drop_event ev,
struct wl_surface *on, double x, double y)
{
- struct wayland_surface *w = conn_surface_for(c, on);
+ (void)c;
+ struct wayland_surface *w = on ?
+ (struct wayland_surface *)wl_surface_get_user_data(on) : NULL;
if (!w || w->parent || !w->cbs->drop)
return;
w->cbs->drop(&w->base, ev, drag_device_pos(w, x, y), w->ud);
@@ -234,7 +236,9 @@ void conn_drop_target(struct wayland_display *c, enum yasl_drop_event ev,
void conn_drag_target(struct wayland_display *c, enum yasl_drag_event ev,
struct wl_surface *on, double x, double y)
{
- struct wayland_surface *w = conn_surface_for(c, on);
+ (void)c;
+ struct wayland_surface *w = on ?
+ (struct wayland_surface *)wl_surface_get_user_data(on) : NULL;
if (!w || w->parent || !w->cbs->drag)
return;
w->cbs->drag(&w->base, ev, drag_device_pos(w, x, y), w->ud);