aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-09-09 16:45:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-09-09 17:01:21 +0000
commitdec6f963cbedb093370f8d9559e357e72a31df90 (patch)
tree3edff5eba8fc336895044e5e193750bd00069006 /selection.c
parentselection: add selection_<type>_unset() (diff)
selection: add selection_<type>_has_data()
Returns true when there is data available for paste in the clipboard/primary selection.
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c12
1 files changed, 12 insertions, 0 deletions
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)
{