Skip to content

Commit

Permalink
#305 changing border properties would incorrectly cause minimized and…
Browse files Browse the repository at this point in the history
… hidden borders to be redrawn
  • Loading branch information
koekeishiya committed Nov 9, 2019
1 parent c5c4f8f commit f6912fc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Properly read window titles on macOS Catalina [#278](https://github.com/koekeishiya/yabai/issues/278)
- Smart swap/warp for window drag actions - the decision to swap or warp is based on where in the window the cursor is [#142](https://github.com/koekeishiya/yabai/issues/142)
- Fix subtle lock-free multithreading bug in the event processing code [#240](https://github.com/koekeishiya/yabai/issues/240)
- Changing border properties should not cause borders of minimized windows or hidden applications to be redrawn [#305](https://github.com/koekeishiya/yabai/issues/305)

## [2.0.1] - 2019-09-04
### Changed
Expand Down
6 changes: 5 additions & 1 deletion src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,12 @@ bool window_is_minimized(struct window *window)
{
Boolean result = 0;
CFTypeRef value;

if (AXUIElementCopyAttributeValue(window->ref, kAXMinimizedAttribute, &value) == kAXErrorSuccess) {
result = CFBooleanGetValue(value);
CFRelease(value);
}

return result || window->is_minimized;
}

Expand Down Expand Up @@ -425,7 +427,9 @@ struct window *window_create(struct application *application, AXUIElementRef win
if ((window_is_standard(window)) || (window_is_dialog(window))) {
border_window_create(window);

if ((!application->is_hidden) && (!window->is_minimized) && (!window->is_fullscreen)) {
if ((!window->application->is_hidden) &&
(!window->is_minimized) &&
(!window->is_fullscreen)) {
border_window_refresh(window);
}
}
Expand Down
17 changes: 13 additions & 4 deletions src/window_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ void window_manager_set_border_window_enabled(struct window_manager *wm, bool en
border_window_create(window);

if ((!window->application->is_hidden) &&
(!window->is_minimized)) {
(!window->is_minimized) &&
(!window->is_fullscreen)) {
border_window_refresh(window);
}

Expand Down Expand Up @@ -400,7 +401,8 @@ void window_manager_set_border_window_width(struct window_manager *wm, int width
CGContextSetLineWidth(window->border.context, width);

if ((!window->application->is_hidden) &&
(!window->is_minimized)) {
(!window->is_minimized) &&
(!window->is_fullscreen)) {
border_window_refresh(window);
}
}
Expand All @@ -423,7 +425,8 @@ void window_manager_set_border_window_radius(struct window_manager *wm, float ra
window->border.radius = radius;

if ((!window->application->is_hidden) &&
(!window->is_minimized)) {
(!window->is_minimized) &&
(!window->is_fullscreen)) {
border_window_refresh(window);
}
}
Expand All @@ -449,7 +452,13 @@ void window_manager_set_normal_border_window_color(struct window_manager *wm, ui
while (bucket) {
if (bucket->value) {
struct window *window = bucket->value;
if (window->id != wm->focused_window_id) border_window_deactivate(window);
if (window->id != wm->focused_window_id) {
if ((!window->application->is_hidden) &&
(!window->is_minimized) &&
(!window->is_fullscreen)) {
border_window_deactivate(window);
}
}
}

bucket = bucket->next;
Expand Down

0 comments on commit f6912fc

Please sign in to comment.