Skip to content

Commit

Permalink
fix regression with space items not being properly redrawn
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKratz committed Feb 22, 2023
1 parent 7835f67 commit 07c0c9a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
41 changes: 20 additions & 21 deletions src/bar_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void bar_manager_init(struct bar_manager* bar_manager) {
bar_manager->window_level = kCGBackstopMenuLevel;
bar_manager->topmost = false;
bar_manager->sticky = false;
bar_manager->picky_redraw = false;
bar_manager->notch_width = 200;
bar_manager->notch_offset = 0;
bar_manager->active_adid = display_arrangement(display_active_display_id());
Expand Down Expand Up @@ -329,26 +328,7 @@ bool bar_manager_bar_needs_redraw(struct bar_manager* bar_manager, struct bar* b

if (disabled_item_drawn_on_bar) return true;

if (bar_item->ignore_association
|| (bar_item->type == BAR_COMPONENT_SPACE))
continue;

bool drawn_on_non_associated_space = bar_item->associated_space > 0
&& !(bar_item->associated_space
& (1 << bar->sid))
&& ((bar_item->associated_bar << 1)
& bar_mask);

if (drawn_on_non_associated_space) return true;

bool not_drawn_on_associated_space = draws_item
&& bar_item->associated_space > 0
&& (bar_item->associated_space
& (1 << bar->sid))
&& !((bar_item->associated_bar << 1)
& bar_mask);

if (not_drawn_on_associated_space) return true;
if (bar_item->ignore_association) continue;

bool not_drawn_on_associated_display =
(draws_item
Expand All @@ -374,6 +354,25 @@ bool bar_manager_bar_needs_redraw(struct bar_manager* bar_manager, struct bar* b

if (drawn_on_non_associated_display) return true;

if (bar_item->type == BAR_COMPONENT_SPACE) continue;

bool drawn_on_non_associated_space = bar_item->associated_space > 0
&& !(bar_item->associated_space
& (1 << bar->sid))
&& ((bar_item->associated_bar << 1)
& bar_mask);

if (drawn_on_non_associated_space) return true;

bool not_drawn_on_associated_space = draws_item
&& bar_item->associated_space > 0
&& (bar_item->associated_space
& (1 << bar->sid))
&& !((bar_item->associated_bar << 1)
& bar_mask);

if (not_drawn_on_associated_space) return true;

}
return false;
}
Expand Down
1 change: 0 additions & 1 deletion src/bar_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct bar_manager {
bool shadow;
bool topmost;
bool sticky;
bool picky_redraw;
bool font_smoothing;
bool any_bar_hidden;
bool needs_ordering;
Expand Down

0 comments on commit 07c0c9a

Please sign in to comment.