From dec6f963cbedb093370f8d9559e357e72a31df90 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 9 Sep 2020 18:45:10 +0200 Subject: selection: add selection__has_data() Returns true when there is data available for paste in the clipboard/primary selection. --- selection.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'selection.c') diff --git a/selection.c b/selection.c index b423fcca..f1129b03 100644 --- a/selection.c +++ b/selection.c @@ -661,6 +661,18 @@ selection_cancel(struct terminal *term) term->selection.ongoing = false; } +bool +selection_clipboard_has_data(const struct seat *seat) +{ + return seat->clipboard.data_offer != NULL; +} + +bool +selection_primary_has_data(const struct seat *seat) +{ + return seat->primary.data_offer != NULL; +} + void selection_clipboard_unset(struct seat *seat) { -- cgit v1.3