aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-11-30 19:04:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-11-30 19:04:17 +0000
commit9e1746cc29321141454c8c8c52716cf59243d963 (patch)
treec197f6aed519af939921a1855bad613f22030822 /selection.c
parentselection: offer clipboard content in more mime types (diff)
selection: do not try to paste un-handled mime types
Closes #230
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/selection.c b/selection.c
index 71f85b7e..cb57fd92 100644
--- a/selection.c
+++ b/selection.c
@@ -1370,7 +1370,9 @@ text_from_clipboard(struct seat *seat, struct terminal *term,
void (*done)(void *user), void *user)
{
struct wl_clipboard *clipboard = &seat->clipboard;
- if (clipboard->data_offer == NULL) {
+ if (clipboard->data_offer == NULL ||
+ clipboard->mime_type == DATA_OFFER_MIME_UNSET)
+ {
done(user);
return;
}
@@ -1512,7 +1514,9 @@ text_from_primary(
}
struct wl_primary *primary = &seat->primary;
- if (primary->data_offer == NULL){
+ if (primary->data_offer == NULL ||
+ primary->mime_type == DATA_OFFER_MIME_UNSET)
+ {
done(user);
return;
}