Skip to content

Commit

Permalink
no redraw when space is fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKratz committed Jan 4, 2022
1 parent 5aef73d commit 625a44a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void bar_draw_graph(struct bar* bar, struct bar_item* bar_item, uint32_t x, bool
}

bool bar_draws_item(struct bar* bar, struct bar_item* bar_item) {
if (!bar_item->drawing) return false;
if (!bar_item->drawing || !bar->shown) return false;
if (bar_item->associated_display > 0 && !(bar_item->associated_display & (1 << bar->adid))) return false;
if (bar_item->associated_space > 0 && !(bar_item->associated_space & (1 << bar->sid)) && (bar_item->type != BAR_COMPONENT_SPACE)) return false;
if (bar_item->position == POSITION_POPUP) return false;
Expand Down Expand Up @@ -223,6 +223,7 @@ struct bar *bar_create(uint32_t did) {
bar->did = did;
bar->sid = mission_control_index(display_space_id(did));
bar->notch_width = CGDisplayIsBuiltin(did) ? g_bar_manager.notch_width : 0;
bar->shown = true;
bar_create_window(bar);
return bar;
}
Expand Down
2 changes: 2 additions & 0 deletions src/bar.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extern CGError SLSClearActivationRegion(uint32_t cid, uint32_t wid);
extern CGError SLSRemoveAllTrackingAreas(uint32_t cid, uint32_t wid);
extern CGError SLSMoveWindow(int cid, uint32_t wid, CGPoint *point);
extern CGError SLSWindowSetShadowProperties(uint32_t wid, CFDictionaryRef properties);
extern int SLSSpaceGetType(int cid, uint64_t sid);

#define kCGSDisableShadowTagBit (1ULL << 3)
#define kCGSHighQualityResamplingTagBit (1ULL << 4)
Expand All @@ -39,6 +40,7 @@ extern CGError SLSWindowSetShadowProperties(uint32_t wid, CFDictionaryRef proper

struct bar {
bool hidden;
bool shown;
uint32_t id;
uint32_t did;
uint32_t sid;
Expand Down
6 changes: 5 additions & 1 deletion src/bar_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,11 @@ void bar_manager_handle_front_app_switch(struct bar_manager* bar_manager) {
}

void bar_manager_handle_space_change(struct bar_manager* bar_manager) {
for (int i = 0; i < bar_manager->bar_count; i++) bar_manager->bars[i]->sid = mission_control_index(display_space_id(bar_manager->bars[i]->did));
for (int i = 0; i < bar_manager->bar_count; i++) {
bar_manager->bars[i]->sid = mission_control_index(display_space_id(bar_manager->bars[i]->did));
bar_manager->bars[i]->shown = SLSSpaceGetType(g_connection, bar_manager->bars[i]->sid) != 4;

}
bar_manager_update_space_components(bar_manager, false);
bar_manager_custom_events_trigger(bar_manager, COMMAND_SUBSCRIBE_SPACE_CHANGE, NULL);
bar_manager_refresh(bar_manager, true);
Expand Down

0 comments on commit 625a44a

Please sign in to comment.