Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,15 +623,15 @@ 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
```

**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

Expand Down
17 changes: 17 additions & 0 deletions src/config/tests/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
4 changes: 2 additions & 2 deletions src/config/types/tablet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -60,7 +60,7 @@ impl Default for TabletInputConfig {
}

fn default_tablet_enabled() -> bool {
false
true
}

fn default_tablet_pressure_enabled() -> bool {
Expand Down
Loading