Merge pull request #516 from mahkoh/jorth/toml-hw-cursor
toml-config: add use-hardware-cursor setting
This commit is contained in:
commit
4cd54f5e79
6 changed files with 26 additions and 0 deletions
|
|
@ -482,6 +482,7 @@ pub struct Config {
|
||||||
pub client_rules: Vec<ClientRule>,
|
pub client_rules: Vec<ClientRule>,
|
||||||
pub window_rules: Vec<WindowRule>,
|
pub window_rules: Vec<WindowRule>,
|
||||||
pub pointer_revert_key: Option<KeySym>,
|
pub pointer_revert_key: Option<KeySym>,
|
||||||
|
pub use_hardware_cursor: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,7 @@ impl Parser for ConfigParser<'_> {
|
||||||
client_rules_val,
|
client_rules_val,
|
||||||
window_rules_val,
|
window_rules_val,
|
||||||
pointer_revert_key_str,
|
pointer_revert_key_str,
|
||||||
|
use_hardware_cursor,
|
||||||
),
|
),
|
||||||
) = ext.extract((
|
) = ext.extract((
|
||||||
(
|
(
|
||||||
|
|
@ -177,6 +178,7 @@ impl Parser for ConfigParser<'_> {
|
||||||
opt(val("clients")),
|
opt(val("clients")),
|
||||||
opt(val("windows")),
|
opt(val("windows")),
|
||||||
recover(opt(str("pointer-revert-key"))),
|
recover(opt(str("pointer-revert-key"))),
|
||||||
|
recover(opt(bol("use-hardware-cursor"))),
|
||||||
),
|
),
|
||||||
))?;
|
))?;
|
||||||
let mut keymap = None;
|
let mut keymap = None;
|
||||||
|
|
@ -491,6 +493,7 @@ impl Parser for ConfigParser<'_> {
|
||||||
client_rules,
|
client_rules,
|
||||||
window_rules,
|
window_rules,
|
||||||
pointer_revert_key,
|
pointer_revert_key,
|
||||||
|
use_hardware_cursor: use_hardware_cursor.despan(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1244,6 +1244,9 @@ fn load_config(initial_load: bool, persistent: &Rc<PersistentState>) {
|
||||||
if let Some(key) = config.pointer_revert_key {
|
if let Some(key) = config.pointer_revert_key {
|
||||||
persistent.seat.set_pointer_revert_key(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 {
|
fn create_command(exec: &Exec) -> Command {
|
||||||
|
|
|
||||||
|
|
@ -879,6 +879,10 @@
|
||||||
"pointer-revert-key": {
|
"pointer-revert-key": {
|
||||||
"type": "string",
|
"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"
|
"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": []
|
"required": []
|
||||||
|
|
|
||||||
|
|
@ -1786,6 +1786,14 @@ The table has the following fields:
|
||||||
|
|
||||||
The value of this field should be a string.
|
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.
|
||||||
|
|
||||||
|
|
||||||
<a name="types-Connector"></a>
|
<a name="types-Connector"></a>
|
||||||
### `Connector`
|
### `Connector`
|
||||||
|
|
|
||||||
|
|
@ -2607,6 +2607,13 @@ Config:
|
||||||
```toml
|
```toml
|
||||||
pointer-revert-key = "NoSymbol"
|
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:
|
Idle:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue