Float native screen sharing and authentication dialogs by default
This commit is contained in:
1 parent
38067726c2
commit
7d73510086
2 files changed
+31
-1
No files matched your search
@@ -71,7 +71,10 @@ pub fn resolve(
|
|||||||
) -> WindowRuleResult {
|
) -> WindowRuleResult {
|
||||||
let app_id = app_id.map(normalize_app_id);
|
let app_id = app_id.map(normalize_app_id);
|
||||||
let mut result = WindowRuleResult::default();
|
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);
|
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]
|
#[test]
|
||||||
fn app_ids_are_normalized_for_matching() {
|
fn app_ids_are_normalized_for_matching() {
|
||||||
let rules = validate(&[WindowRuleConfig {
|
let rules = validate(&[WindowRuleConfig {
|
||||||
|
|||||||
@@ -307,6 +307,9 @@ this command. Both modes open Satty with the same save and copy workflow.
|
|||||||
|
|
||||||
## Window rules
|
## Window rules
|
||||||
|
|
||||||
|
Native authentication and display-sharing dialogs float by default. Explicit
|
||||||
|
window rules can override that behavior.
|
||||||
|
|
||||||
| `window-rule` key | Type | Default / meaning |
|
| `window-rule` key | Type | Default / meaning |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `app_id` | nonempty string | Optional exact match; case-insensitive, `.desktop` suffix ignored |
|
| `app_id` | nonempty string | Optional exact match; case-insensitive, `.desktop` suffix ignored |
|
||||||
|
|||||||
Reference in new issue
Block a user