summaryrefslogtreecommitdiff
path: root/src/wayland/pointer.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-12 00:09:38 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-12 00:09:38 +0300
commit624d1371304a5ae4b3429ad5e4267aac7cd03dfd (patch)
tree32de069f6eec83686521fc4bf39cc9874b123e93 /src/wayland/pointer.c
parente813252e685d761235ad45e170d97c9375f51958 (diff)
missing impls and hardening
Diffstat (limited to 'src/wayland/pointer.c')
-rw-r--r--src/wayland/pointer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wayland/pointer.c b/src/wayland/pointer.c
index d434047..3b3ad73 100644
--- a/src/wayland/pointer.c
+++ b/src/wayland/pointer.c
@@ -1032,10 +1032,9 @@ static void clipboard_received(const char *text, size_t len, bool uri_list,
{
struct seat *s = ud;
struct wayland_display *c = s->conn;
- struct wayland_surface *w = on ? surface_root(conn_surface_for(c, on)) : NULL;
- if (!w)
- w = c->paste_target ? c->paste_target : s->keyboard_focus;
- if (!len || !w) return;
+ struct wayland_surface *w = conn_surface_for(c, on);
+ if (uri_list) w = surface_root(w);
+ if (!w || w->closed) return;
struct yasl_input_event ev = {
.surface = &w->base,
.kind = uri_list ? YASL_INPUT_DROP_FILES : YASL_INPUT_PASTE,
@@ -1216,6 +1215,7 @@ void seat_bind(struct wayland_display *c, struct wl_registry *registry,
void seat_forget_surface(struct seat *s, struct wayland_surface *w)
{
+ clipboard_forget_surface(s->clipboard, w->surface);
struct wayland_surface **refs[] = {
&s->pointer_focus, &s->keyboard_focus,
&s->tablet_focus, &s->ime_focus, &s->focus_leaving, &s->ptr_left,