diff options
Diffstat (limited to 'src/wayland/pointer.c')
| -rw-r--r-- | src/wayland/pointer.c | 8 |
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, |
