Skip to content

Commit

Permalink
Merge pull request #7 from donovanglover/fix/dim-strength
Browse files Browse the repository at this point in the history
fix: Reset dim_strength if no_dim_when_only
  • Loading branch information
donovanglover authored Aug 14, 2023
2 parents e8a1049 + 3a564b3 commit 631a69d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,25 @@ fn main() -> hyprland::Result<()> {
}
}

*is_set_dim.lock().unwrap() = false;

// Don't dim when switching to another workspace with only one window
if no_dim_when_only {
if (parent_workspace.windows == 1 || parent_workspace.fullscreen)
&& !is_special_workspace
{
Keyword::set("decoration:dim_strength", 0).unwrap();
log("info: Parent workspace only has one window or that window is fullscreen, so not dimming.");
return;
}

if is_special() && special_only_has_one_visible_window() {
Keyword::set("decoration:dim_strength", 0).unwrap();
log("info: Special workspace only has one window, so not dimming.");
return;
}
}

*is_set_dim.lock().unwrap() = false;
spawn_dim_thread(num_threads, is_set_dim, strength, persist, duration, false);
});

Expand Down

0 comments on commit 631a69d

Please sign in to comment.