aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--selection.c12
-rw-r--r--selection.h3
2 files changed, 15 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)
{
diff --git a/selection.h b/selection.h
index 178a990b..547da2fc 100644
--- a/selection.h
+++ b/selection.h
@@ -33,6 +33,9 @@ void selection_mark_row(
void selection_clipboard_unset(struct seat *seat);
void selection_primary_unset(struct seat *seat);
+bool selection_clipboard_has_data(const struct seat *seat);
+bool selection_primary_has_data(const struct seat *seat);
+
char *selection_to_text(const struct terminal *term);
void selection_to_clipboard(
struct seat *seat, struct terminal *term, uint32_t serial);