config: make focus-follows-mouse optional
This commit is contained in:
parent
fe2663fca3
commit
a12065a915
14 changed files with 96 additions and 6 deletions
|
|
@ -312,6 +312,7 @@ pub struct Config {
|
|||
pub inputs: Vec<Input>,
|
||||
pub idle: Option<Duration>,
|
||||
pub explicit_sync_enabled: Option<bool>,
|
||||
pub focus_follows_mouse: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ impl Parser for ConfigParser<'_> {
|
|||
_,
|
||||
idle_val,
|
||||
),
|
||||
(explicit_sync, repeat_rate_val, complex_shortcuts_val),
|
||||
(explicit_sync, repeat_rate_val, complex_shortcuts_val, focus_follows_mouse),
|
||||
) = ext.extract((
|
||||
(
|
||||
opt(val("keymap")),
|
||||
|
|
@ -127,6 +127,7 @@ impl Parser for ConfigParser<'_> {
|
|||
recover(opt(bol("explicit-sync"))),
|
||||
opt(val("repeat-rate")),
|
||||
opt(val("complex-shortcuts")),
|
||||
recover(opt(bol("focus-follows-mouse"))),
|
||||
),
|
||||
))?;
|
||||
let mut keymap = None;
|
||||
|
|
@ -307,6 +308,7 @@ impl Parser for ConfigParser<'_> {
|
|||
render_device,
|
||||
inputs,
|
||||
idle,
|
||||
focus_follows_mouse: focus_follows_mouse.despan().unwrap_or(true),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ use {
|
|||
config, config_dir,
|
||||
exec::{set_env, unset_env, Command},
|
||||
get_workspace,
|
||||
input::{get_seat, input_devices, on_new_input_device, InputDevice, Seat},
|
||||
input::{
|
||||
get_seat, input_devices, on_new_input_device, FocusFollowsMouseMode, InputDevice, Seat,
|
||||
},
|
||||
is_reload,
|
||||
keyboard::{Keymap, ModifiedKeySym},
|
||||
logging::set_log_level,
|
||||
|
|
@ -869,6 +871,12 @@ fn load_config(initial_load: bool, persistent: &Rc<PersistentState>) {
|
|||
}
|
||||
}
|
||||
});
|
||||
persistent
|
||||
.seat
|
||||
.set_focus_follows_mouse_mode(match config.focus_follows_mouse {
|
||||
true => FocusFollowsMouseMode::True,
|
||||
false => FocusFollowsMouseMode::False,
|
||||
});
|
||||
}
|
||||
|
||||
fn create_command(exec: &Exec) -> Command {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue