diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 17:08:48 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 17:08:48 +0300 |
| commit | ac6f9f5e7711521455b83ceb843a25e091646d43 (patch) | |
| tree | 0dfd5fc46a605cd4980ef3c9131ddbaa2270c78a /src/platform/wayland/backend.c | |
| parent | d4d13e616cb15ef22479d9cb97922af93317a01a (diff) | |
Report the system double-click interval
wsap_term hardcodes 400 ms in three places to count clicks.
yasl_display_double_click_ms() reads the interval from the system. X11
parses Net/DoubleClickTime from the XSETTINGS owner's property. Wayland
has no protocol for it, so it asks the Settings portal for KDE's
DoubleClickInterval, which KDE sends as a string and which exists only
when the user set it, then GNOME's double-click. X11 without XSETTINGS
asks the portal too. Cocoa reads NSEvent.doubleClickInterval. Missing or
implausible values give YASL_DOUBLE_CLICK_MS_DEFAULT, 400 ms.
The X11 state test covers the XSETTINGS parser in both byte orders and
with truncation. The Xwayland test owns the settings selection. The
desktop test serves both portal keys. The Cocoa path is not built or run
here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/platform/wayland/backend.c')
| -rw-r--r-- | src/platform/wayland/backend.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/platform/wayland/backend.c b/src/platform/wayland/backend.c index c6272ce..ad9ed4c 100644 --- a/src/platform/wayland/backend.c +++ b/src/platform/wayland/backend.c @@ -1,4 +1,5 @@ #include "platform/wayland/internal.h" +#include "platform/freedesktop/dbus.h" static struct yasl_display *impl_display_open(struct yasl_loop *loop, const struct yasl_display_spec *spec) { @@ -31,6 +32,13 @@ static int impl_display_modifiers(const struct yasl_display *d) return wayland_display_modifiers((const struct wayland_display *)d); } +static int impl_display_double_click_ms(const struct yasl_display *d) +{ + /* Wayland has no protocol for it; desktops publish it as a setting. */ + (void)d; + return portal_double_click_ms(); +} + static void impl_display_copy(struct yasl_display *d, enum yasl_selection sel, const char *text) { wayland_display_copy((struct wayland_display *)d, sel, text); @@ -202,6 +210,7 @@ const struct yasl_backend_ops yasl_wayland_backend = { .display_dispatch_timeout = impl_display_dispatch_timeout, .display_flush = impl_display_flush, .display_modifiers = impl_display_modifiers, + .display_double_click_ms = impl_display_double_click_ms, .display_copy = impl_display_copy, .display_paste = impl_display_paste, .display_drag_start = impl_display_drag_start, |
