Add display mode chooser and align screen-sharing styles
Open the four display modes from XF86Display or the external-monitor bar icon. Reuse output reconciliation and confirmation for manual layout changes, and notify the shell when monitor state changes. Release backdrop locks before render-element queries to prevent blurred popups from freezing the compositor. Cover popup open, update and close with regression tests. Share translucent card styles between display modes and capture sources, show focus rings during keyboard navigation, and align picker buttons, label sizing and footer spacing with system modals.
This commit is contained in:
1 parent
5100d533fb
commit
96f5ee442e
30 files changed
+1354
-72
No files matched your search
@@ -386,6 +386,31 @@ pub(crate) fn config_path() -> Option<PathBuf> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn display_key_has_a_default_binding_and_can_be_rebound() {
|
||||
let bindings = parse("").runtime_config().unwrap().bindings;
|
||||
assert!(bindings.iter().any(
|
||||
|binding| binding.trigger == BindingTrigger::Keysym(keysyms::KEY_XF86Display)
|
||||
&& binding.action == BindingAction::ToggleDisplayMode
|
||||
));
|
||||
let bindings = parse(
|
||||
"binding keys=\"XF86Display\" disabled=#true\nbinding keys=\"Super+P\" action=\"toggle-display-mode\"\n",
|
||||
)
|
||||
.runtime_config()
|
||||
.unwrap()
|
||||
.bindings;
|
||||
assert!(
|
||||
!bindings
|
||||
.iter()
|
||||
.any(|binding| binding.trigger == BindingTrigger::Keysym(keysyms::KEY_XF86Display))
|
||||
);
|
||||
assert!(
|
||||
bindings
|
||||
.iter()
|
||||
.any(|binding| binding.modifiers.logo && binding.action == BindingAction::ToggleDisplayMode)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shortcut_hint_has_a_default_binding_and_can_be_rebound() {
|
||||
let bindings = parse("").runtime_config().unwrap().bindings;
|
||||
@@ -925,7 +950,7 @@ mod tests {
|
||||
let input = config.input_settings().unwrap();
|
||||
let bindings = config.bindings(&input).unwrap();
|
||||
|
||||
assert_eq!(bindings.len(), 53);
|
||||
assert_eq!(bindings.len(), 54);
|
||||
for (shift, action) in [
|
||||
(false, BindingAction::ToggleMaximized),
|
||||
(true, BindingAction::ToggleFullscreen),
|
||||
@@ -969,7 +994,7 @@ mod tests {
|
||||
|
||||
let input = replaced.input_settings().unwrap();
|
||||
let bindings = replaced.bindings(&input).unwrap();
|
||||
assert_eq!(bindings.len(), 53);
|
||||
assert_eq!(bindings.len(), 54);
|
||||
assert!(bindings.iter().any(|binding| {
|
||||
binding.action
|
||||
== BindingAction::Spawn(vec!["foot".to_owned(), "--app-id".to_owned(), "work".to_owned()].into())
|
||||
@@ -977,7 +1002,7 @@ mod tests {
|
||||
|
||||
let input = unbound.input_settings().unwrap();
|
||||
let bindings = unbound.bindings(&input).unwrap();
|
||||
assert_eq!(bindings.len(), 52);
|
||||
assert_eq!(bindings.len(), 53);
|
||||
assert!(!bindings.iter().any(|binding| binding.action == BindingAction::Close));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user