diff --git a/toml-config/src/config.rs b/toml-config/src/config.rs index 7c2ccc32..ec77f760 100644 --- a/toml-config/src/config.rs +++ b/toml-config/src/config.rs @@ -482,6 +482,7 @@ pub struct Config { pub client_rules: Vec, pub window_rules: Vec, pub pointer_revert_key: Option, + pub use_hardware_cursor: Option, } #[derive(Debug, Error)] diff --git a/toml-config/src/config/parsers/config.rs b/toml-config/src/config/parsers/config.rs index 74f63589..8b102fb0 100644 --- a/toml-config/src/config/parsers/config.rs +++ b/toml-config/src/config/parsers/config.rs @@ -131,6 +131,7 @@ impl Parser for ConfigParser<'_> { client_rules_val, window_rules_val, pointer_revert_key_str, + use_hardware_cursor, ), ) = ext.extract(( ( @@ -177,6 +178,7 @@ impl Parser for ConfigParser<'_> { opt(val("clients")), opt(val("windows")), recover(opt(str("pointer-revert-key"))), + recover(opt(bol("use-hardware-cursor"))), ), ))?; let mut keymap = None; @@ -491,6 +493,7 @@ impl Parser for ConfigParser<'_> { client_rules, window_rules, pointer_revert_key, + use_hardware_cursor: use_hardware_cursor.despan(), }) } } diff --git a/toml-config/src/lib.rs b/toml-config/src/lib.rs index 87709ca2..01bcb7fe 100644 --- a/toml-config/src/lib.rs +++ b/toml-config/src/lib.rs @@ -1244,6 +1244,9 @@ fn load_config(initial_load: bool, persistent: &Rc) { if let Some(key) = config.pointer_revert_key { persistent.seat.set_pointer_revert_key(key); } + if let Some(v) = config.use_hardware_cursor { + persistent.seat.use_hardware_cursor(v); + } } fn create_command(exec: &Exec) -> Command { diff --git a/toml-spec/spec/spec.generated.json b/toml-spec/spec/spec.generated.json index 890e0971..d7c7dc61 100644 --- a/toml-spec/spec/spec.generated.json +++ b/toml-spec/spec/spec.generated.json @@ -879,6 +879,10 @@ "pointer-revert-key": { "type": "string", "description": "Sets the keysym that can be used to revert the pointer to the default state.\n\nPressing this key cancels any grabs, drags, selections, etc.\n\nThe default is `Escape`. Setting this to `NoSymbol` effectively disables\nthis functionality.\n\nThe value of the string should be the name of a keysym. The authoritative location\nfor these names is [1] with the `XKB_KEY_` prefix removed.\n\n[1]: https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h\n\n- Example:\n\n ```toml\n pointer-revert-key = \"NoSymbol\"\n ```\n" + }, + "use-hardware-cursor": { + "type": "boolean", + "description": "Configures whether the default seat uses hardware cursors.\n\nThe default is `true`.\n" } }, "required": [] diff --git a/toml-spec/spec/spec.generated.md b/toml-spec/spec/spec.generated.md index 505d8958..33327424 100644 --- a/toml-spec/spec/spec.generated.md +++ b/toml-spec/spec/spec.generated.md @@ -1786,6 +1786,14 @@ The table has the following fields: The value of this field should be a string. +- `use-hardware-cursor` (optional): + + Configures whether the default seat uses hardware cursors. + + The default is `true`. + + The value of this field should be a boolean. + ### `Connector` diff --git a/toml-spec/spec/spec.yaml b/toml-spec/spec/spec.yaml index 9efcc9f4..efdb960c 100644 --- a/toml-spec/spec/spec.yaml +++ b/toml-spec/spec/spec.yaml @@ -2607,6 +2607,13 @@ Config: ```toml pointer-revert-key = "NoSymbol" ``` + use-hardware-cursor: + kind: boolean + required: false + description: | + Configures whether the default seat uses hardware cursors. + + The default is `true`. Idle: