Repository navigation
feat(linux): read double-click interval from XDG Settings portal with kdeglobals and GSettings fallback - #1923
Merged
Merged
Conversation
… kdeglobals and GSettings fallback
This was referenced Nov 24, 2026
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
…une and procwatch (#2370) A feature-set warning sweep across Linux, macOS, Windows, and wasm32 found eight dead-code warnings under optional and non-default feature sets: - `crates/rune/src/open_path.rs:203` (`file_uri_from_bytes`, added in #1947): used on Unix only under `feature = "dbus"` (FileManager1) and tests; gate with `feature = "dbus"` alongside `test`. - `crates/rune/src/platform/preferences.rs:77` (`DEFAULT_DOUBLE_CLICK_SECS`, added in #1923/#2128): used on Linux only under `feature = "dbus"` and tests; gate with `all(target_os = "linux", feature = "dbus")` alongside `test`. - `crates/rune/src/window/titlebar/linux.rs:82` (`Sides::ALL`, added in #2244): used only in `linux_tests.rs`; gate with `#[cfg(test)]`. - `crates/rune/src/frame/live_log.rs:33` (`CAPTURED` / `capture_frames`, added in #2309): used only in `window/win32/resize_sync/tests.rs` under `frame-profile`; gate with `#[cfg(all(test, target_os = "windows"))]`. - `crates/procwatch/src/alloc/sites.rs:222,271,413,418` (`report`, `unsampled`, `os::modules`, `os::nt_heaps`, added in #744): `alloc-sites` sampling and dumper are Windows-only; gate the implementation behind `#[cfg(windows)]` with clean `#[cfg(not(windows))]` no-op stubs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #545
Reads the Linux desktop's configured double-click interval instead of leaving
Runtime::double_click_intervalfixed at0.5s, bringing Linux in line with macOS (NSEvent::doubleClickInterval) and Windows (GetDoubleClickTime) without changing the public API.Resolution order
flowchart LR A[rune-appearance-portal worker] -->|ReadOne / Read + SettingChanged| B["org.freedesktop.portal.Settings<br/>org.gnome.desktop.peripherals.mouse / double-click"] B -->|i32 / u32 ms, clamped 50..=5000| C[AtomicU32 cache] B -->|portal absent or key missing| D{XDG_CURRENT_DESKTOP<br/>includes KDE?} D -->|yes| E["kdeglobals<br/>[KDE] DoubleClickInterval"] D -->|no| F["dlopen libgio-2.0.so.0<br/>g_settings_get_int"] F -->|unavailable| E E -->|clamped 50..=5000 ms| C F -->|clamped 50..=5000 ms| C C -->|unanswered = 0.5 s| G[Host / Overlay rt.double_click_interval]Changes
crates/rune/src/platform/portal_appearance.rs): extend the existingrune-appearance-portalbackground worker to read and watchorg.gnome.desktop.peripherals.mousedouble-click(unwrapping nestedValue::Valuei32/u32milliseconds, rejecting non-positive values, clamping to50..=5000ms), store it in anAtomicU32with a portal-authority bit so a one-shot fallback never overwrites a portal answer, and request window redraws only when the effective interval changes.crates/rune/src/platform/preferences.rs): exposepreferences::double_click_interval() -> f64(defaulting to0.5s) andread_double_click_fallback() -> Option<u32>, checkingkdeglobals[KDE]DoubleClickIntervalon KDE desktops andlibgio-2.0.so.0g_settings_get_int(withkdeglobalsfallback if GIO or the schema is absent) elsewhere. When compiled without thedbusfeature, run the fallback once on a short-lived worker thread (CachedDoubleClick). Sharedwith_gsettingshandles schema lookup and reference cleanup for bothenable-animationsanddouble-click.crates/rune/src/window/host/create.rs,crates/rune/src/window/host/events.rs,crates/rune/src/window/host/lifecycle.rs,crates/rune/src/input/host_events.rs,crates/rune/src/overlay.rs,crates/rune/src/overlay/lifetime.rs,crates/rune/src/overlay/any_host.rs): applypreferences::double_click_interval()on Linux window/overlay creation and refresh it from the cached atomic on portal-triggered redraws, reveals and focus changes with zero UI-thread D-Bus or filesystem I/O.crates/rune/src/runtime.rs,crates/rune/README.md,crates/rune/src/platform/portal_appearance_tests.rs,crates/rune/src/platform/preferences_tests.rs,changelog/unreleased/2026-11-24-linux-double-click-interval.md): document Linux support and cover decoding, clamping,kdeglobalsparsing, fallback precedence, off-thread caching and atomic updates.Outside answer followed
org.freedesktop.portal.Settings(org.gnome.desktop.peripherals.mousedouble-clickin ms), GNOME GSettings (org.gnome.desktop.peripherals.mousedouble-click), and KDE KConfig (kdeglobals[KDE]DoubleClickIntervalin ms), matching GTK 4, Chromium and Qt.App/Txsetter was added: system settings driveRuntime::double_click_intervalon macOS and Windows already, andRuntime::double_click_intervalremains unchanged for headless tests.Notes on verification
dbusand--no-default-features), macOS, and wasm32 (WebGPU and WebGL2).libgio-2.0.so.0GSettings database; that thin edge is compiled and unit-tested behind the pure decoding/clamping/parsing helpers.