summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/backend.c7
-rw-r--r--src/common/backend.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/common/backend.c b/src/common/backend.c
index d35d243..b15233f 100644
--- a/src/common/backend.c
+++ b/src/common/backend.c
@@ -110,6 +110,13 @@ int yasl_display_modifiers(const struct yasl_display *d)
return d->ops->display_modifiers(d);
}
+int yasl_display_double_click_ms(const struct yasl_display *d)
+{
+ int ms = d && d->ops->display_double_click_ms ? d->ops->display_double_click_ms(d) : 0;
+ /* Reject nonsense from misconfigured settings as well as no answer. */
+ return ms > 0 && ms <= 10000 ? ms : YASL_DOUBLE_CLICK_MS_DEFAULT;
+}
+
void yasl_display_copy(struct yasl_display *d, enum yasl_selection sel, const char *text)
{
if (!d || !d->ops->display_copy || !text ||
diff --git a/src/common/backend.h b/src/common/backend.h
index fd60418..96ce9e7 100644
--- a/src/common/backend.h
+++ b/src/common/backend.h
@@ -57,6 +57,8 @@ struct yasl_backend_ops {
int (*display_dispatch_timeout)(struct yasl_display *d, int timeout_ms);
void (*display_flush)(struct yasl_display *d);
int (*display_modifiers)(const struct yasl_display *d);
+ /* Optional; returns zero or less when the system reports no interval. */
+ int (*display_double_click_ms)(const struct yasl_display *d);
void (*display_copy)(struct yasl_display *d, enum yasl_selection sel, const char *text);
void (*display_paste)(struct yasl_display *d, enum yasl_selection sel, struct yasl_surface *target);
bool (*display_drag_start)(struct yasl_display *d, struct yasl_surface *origin, const struct yasl_drag_image *image, const struct yasl_drag_listener *l, void *ud);