Skip to content

Commit

Permalink
fix: clear inactive window border color when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Jul 29, 2024
1 parent 5bbf7b5 commit 9ed53f2
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions packages/wm/src/common/commands/platform_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,24 @@ fn apply_window_effects(
) {
// TODO: Be able to add transparency to windows.

let enable_borders = match is_focused {
true => config.value.window_effects.focused_window.border.enabled,
false => config.value.window_effects.other_windows.border.enabled,
let window_effects = &config.value.window_effects;

// Skip if both focused + non-focused window effects are disabled.
if !window_effects.focused_window.border.enabled
&& !window_effects.other_windows.border.enabled
{
return;
};

if enable_borders {
let border_config = match is_focused {
true => &config.value.window_effects.focused_window.border,
false => &config.value.window_effects.other_windows.border,
}
.clone();
let border_config = match is_focused {
true => &config.value.window_effects.focused_window.border,
false => &config.value.window_effects.other_windows.border,
};

_ = window.native().set_border_color(Some(&border_config.color));
}
let border_color = match border_config.enabled {
true => Some(&border_config.color),
false => None,
};

_ = window.native().set_border_color(border_color);
}

0 comments on commit 9ed53f2

Please sign in to comment.