Skip to content

Commit

Permalink
feat: reset transparency if effect is halfdisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jackssrt committed Dec 4, 2024
1 parent 51511c2 commit ea61e61
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions packages/wm/src/common/commands/platform_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use tokio::task;
use tracing::warn;

use crate::{
common::{platform::Platform, DisplayState},
common::{
platform::Platform, DisplayState, TransparencyUnit, TransparencyValue,
},
containers::{
traits::{CommonGetters, PositionGetters},
Container, WindowContainer,
Expand Down Expand Up @@ -291,9 +293,19 @@ fn apply_transparency_effect(
window: &WindowContainer,
effect_config: &WindowEffectConfig,
) {
if effect_config.transparency.enabled {
_ = window
.native()
.set_transparency(effect_config.transparency.transparency.clone());
}
_ = window.native().set_transparency(
if effect_config.transparency.enabled {
effect_config.transparency.transparency.clone()
} else {
// This code is only reached if the transparency effect is only
// enabled in one of the two window effect configurations. In
// this case, reset the transparency to default.
TransparencyValue {
amount: 0.0,
unit: TransparencyUnit::Exact,
delta_sign: false,
is_delta: false,
}
},
)
}

0 comments on commit ea61e61

Please sign in to comment.