diff --git a/README.md b/README.md index ee0bf8b4..8de76573 100644 --- a/README.md +++ b/README.md @@ -679,7 +679,7 @@ Notes: ### Tablet/Stylus Support -Tablet support (`zwp_tablet_v2`) ships in default builds but is disabled at runtime by default: +Tablet support (`zwp_tablet_v2`) ships in default builds and is enabled at runtime by default: ```toml [tablet] @@ -689,7 +689,7 @@ min_thickness = 1.0 max_thickness = 8.0 ``` -Enable it in `config.toml` and restart wayscriber. To build without tablet support: `cargo build --release --no-default-features` (or remove the `tablet-input` feature). +It works out of the box in default builds. Set `[tablet].enabled = false` in `config.toml` to opt out. To build without tablet support: `cargo build --release --no-default-features` (or remove the `tablet-input` feature). See https://wayscriber.com/docs/ for the full reference. diff --git a/config.example.toml b/config.example.toml index bf2ea799..152809ca 100644 --- a/config.example.toml +++ b/config.example.toml @@ -822,12 +822,12 @@ custom_redo_steps = 5 # ═══════════════════════════════════════════════════════════════════════════════ # TABLET / STYLUS INPUT (Wayland tablet-unstable-v2) -# Build with `--features tablet-input` and enable below to use +# Build with `--features tablet-input` to use # ═══════════════════════════════════════════════════════════════════════════════ [tablet] -# Enable tablet/stylus input at runtime -enabled = false +# Enable tablet/stylus input at runtime (set false to opt out) +enabled = true # Map pressure to thickness pressure_enabled = true diff --git a/docs/CONFIG.md b/docs/CONFIG.md index aaaf91cf..972d628e 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -623,7 +623,7 @@ Runtime toggles for tablet/stylus input (Wayland `zwp_tablet_v2`). ```toml [tablet] -enabled = false +enabled = true pressure_enabled = true min_thickness = 1.0 max_thickness = 8.0 @@ -631,7 +631,7 @@ max_thickness = 8.0 **Notes:** - Requires the `tablet-input` feature at build time (enabled in default release builds). -- Set `enabled = true` to activate tablet input at runtime. +- Tablet input is enabled by default when the feature is compiled in; set `enabled = false` to opt out. ### `[session]` - Session Persistence diff --git a/src/config/tests/load.rs b/src/config/tests/load.rs index e1040374..f4c47b30 100644 --- a/src/config/tests/load.rs +++ b/src/config/tests/load.rs @@ -58,3 +58,20 @@ fn ui_defaults_follow_desktop_for_xdg_focus_loss() { assert_eq!(Config::default().ui.xdg_focus_loss_behavior, expected); } + +#[cfg(tablet)] +#[test] +fn load_defaults_tablet_input_to_enabled_when_section_is_missing() { + with_temp_config_home(|config_root| { + let primary_dir = config_root.join(PRIMARY_CONFIG_DIR); + fs::create_dir_all(&primary_dir).unwrap(); + fs::write( + primary_dir.join("config.toml"), + "[drawing]\ndefault_color = 'red'\n", + ) + .unwrap(); + + let loaded = Config::load().expect("load succeeds"); + assert!(loaded.config.tablet.enabled); + }); +} diff --git a/src/config/types/tablet.rs b/src/config/types/tablet.rs index d4f7faa3..907efb62 100644 --- a/src/config/types/tablet.rs +++ b/src/config/types/tablet.rs @@ -46,7 +46,7 @@ pub struct TabletInputConfig { impl Default for TabletInputConfig { fn default() -> Self { Self { - enabled: false, + enabled: true, pressure_enabled: true, min_thickness: 1.0, max_thickness: 8.0, @@ -60,7 +60,7 @@ impl Default for TabletInputConfig { } fn default_tablet_enabled() -> bool { - false + true } fn default_tablet_pressure_enabled() -> bool {