selection: use appropriate check for PRIMARY paste

Assume it could be a copy-paste typo. We should check PRIMARY, not
CLIPBOARD. Without this fix, we can't use PRIMARY until we copy anything
to CLIPBOARD.
This commit is contained in:
Sergey Nazaryev 2020-10-10 21:13:08 +03:00 committed by Daniel Eklöf
parent 282af44784
commit e842f49367
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 3 additions and 2 deletions

View file

@ -56,6 +56,7 @@
* Crash after either resizing a window or changing the font size if
there were sixels present in the scrollback while doing so.
* _Send Device Attributes_ to only send a response if `Ps == 0`.
* Paste from primary when clipboard is empty.
### Security

View file

@ -1381,8 +1381,8 @@ selection_from_primary(struct seat *seat, struct terminal *term)
return;
}
struct wl_clipboard *clipboard = &seat->clipboard;
if (clipboard->data_offer == NULL)
struct wl_primary *primary = &seat->primary;
if (primary->data_offer == NULL)
return;
term->is_sending_paste_data = true;