diff --git a/compositor/src/window_rules.rs b/compositor/src/window_rules.rs index 7cadaa5..2fec2a6 100644 --- a/compositor/src/window_rules.rs +++ b/compositor/src/window_rules.rs @@ -71,7 +71,10 @@ pub fn resolve( ) -> WindowRuleResult { let app_id = app_id.map(normalize_app_id); let mut result = WindowRuleResult::default(); - if app_id.as_deref() == Some("dev.ferese.Authentication") { + if matches!( + app_id.as_deref(), + Some("dev.ferese.authentication" | "dev.ferese.screenshare") + ) { result.floating = Some(true); } @@ -211,6 +214,30 @@ mod tests { } } + #[test] + fn native_dialogs_float_by_default_and_allow_user_overrides() { + for app_id in [ + "dev.ferese.ScreenShare", + "dev.ferese.ScreenShare.desktop", + "dev.ferese.Authentication", + ] { + assert_eq!(resolve(&[], Some(app_id), None, false).floating, Some(true)); + let rules = validate(&[WindowRuleConfig { + floating: Some(false), + ..config(app_id) + }]) + .unwrap(); + assert_eq!( + resolve(&rules, Some(app_id), None, false).floating, + Some(false) + ); + } + assert_eq!( + resolve(&[], Some("org.example.Editor"), None, false).floating, + None + ); + } + #[test] fn app_ids_are_normalized_for_matching() { let rules = validate(&[WindowRuleConfig { diff --git a/docs/configuration.md b/docs/configuration.md index 3b6b440..514f171 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -307,6 +307,9 @@ this command. Both modes open Satty with the same save and copy workflow. ## Window rules +Native authentication and display-sharing dialogs float by default. Explicit +window rules can override that behavior. + | `window-rule` key | Type | Default / meaning | | --- | --- | --- | | `app_id` | nonempty string | Optional exact match; case-insensitive, `.desktop` suffix ignored |