Skip to content

Commit

Permalink
#2127 allow resetting window opacity through window rules
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Feb 26, 2024
1 parent 1072dcf commit b0b0eeb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Managed windows should snap back into place when moved incorrectly using the mouse [#1199](https://github.com/koekeishiya/yabai/issues/1199) [#2066](https://github.com/koekeishiya/yabai/issues/2066)
- Managed windows should correct their frame when modified by external means [#2117](https://github.com/koekeishiya/yabai/issues/2117)
- Window frame would sometimes not be set correctly when using window animations [#2120](https://github.com/koekeishiya/yabai/issues/2120)
- Allow resetting window opacity in window rules [#2127](https://github.com/koekeishiya/yabai/issues/2127)

## [6.0.15] - 2024-02-22
### Changed
Expand Down
4 changes: 4 additions & 0 deletions doc/yabai.1
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,15 @@ When focusing the window, put the mouse at its center. Overrides the global \fBm
\fBlayer=\fI<LAYER>\fP\fP
.RS 4
Window is ordered within the given stacking layer. The window will no longer be eligible for automatic change in layer when managed/unmanaged.
.br
Specify the value \fIauto\fP to reset back to normal and make it become automatically managed.
.RE
.sp
\fBopacity=\fI<FLOAT_SEL>\fP\fP
.RS 4
Set window opacity. The window will no longer be eligible for automatic change in opacity upon focus change.
.br
Specify the value \fI0.0\fP to reset back to full opacity and make it become automatically managed.
.RE
.sp
\fBnative\-fullscreen=\fI<BOOL_SEL>\fP\fP
Expand Down
6 changes: 4 additions & 2 deletions doc/yabai.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,12 @@ ARGUMENT
When focusing the window, put the mouse at its center. Overrides the global *mouse_follows_focus* setting.

*layer='<LAYER>'*::
Window is ordered within the given stacking layer. The window will no longer be eligible for automatic change in layer when managed/unmanaged.
Window is ordered within the given stacking layer. The window will no longer be eligible for automatic change in layer when managed/unmanaged. +
Specify the value 'auto' to reset back to normal and make it become automatically managed.

*opacity='<FLOAT_SEL>'*::
Set window opacity. The window will no longer be eligible for automatic change in opacity upon focus change.
Set window opacity. The window will no longer be eligible for automatic change in opacity upon focus change. +
Specify the value '0.0' to reset back to full opacity and make it become automatically managed.

*native-fullscreen='<BOOL_SEL>'*::
Window should enter native macOS fullscreen mode.
Expand Down
2 changes: 1 addition & 1 deletion src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -2316,7 +2316,7 @@ static void handle_domain_rule(FILE *rsp, struct token domain, char *message)
} else if (string_equals(key, ARGUMENT_RULE_KEY_ALPHA)) {
if (exclusion) unsupported_exclusion = key;

if ((sscanf(value, "%f", &rule.alpha) != 1) || (!in_range_ei(rule.alpha, 0.0f, 1.0f))) {
if ((sscanf(value, "%f", &rule.alpha) != 1) || (!in_range_ii(rule.alpha, 0.0f, 1.0f))) {
daemon_fail(rsp, "invalid value '%s' for key '%s'\n", value, key);
did_parse = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/window_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void window_manager_apply_rule_to_window(struct space_manager *sm, struct window
window_manager_set_window_layer(window, rule->layer);
}

if (in_range_ei(rule->alpha, 0.0f, 1.0f)) {
if (in_range_ii(rule->alpha, 0.0f, 1.0f)) {
window->opacity = rule->alpha;
window_manager_set_opacity(wm, window, rule->alpha);
}
Expand Down

0 comments on commit b0b0eeb

Please sign in to comment.