Skip to content

Commit

Permalink
fix: properly refresh shadows and rounded corners
Browse files Browse the repository at this point in the history
JavaScript's .forEach function does not work the way I expected it to,
it seems like you have to do `.forEach((e) => ...)` instead of
`.forEach(...)`, so my code wasn't refreshing the state properly.

Thanks to @bsneed for pointing this out.
  • Loading branch information
flexagoon committed Aug 19, 2024
1 parent 9970315 commit 98096c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/manager/event_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ function refreshShadow(actor: ExtensionsWindowActor) {

/** Refresh the style of all shadow actors */
function refreshAllShadows() {
global.get_window_actors().forEach(refreshShadow);
for (const actor of global.get_window_actors()) {
refreshShadow(actor);
}
}

/**
Expand Down Expand Up @@ -442,6 +444,8 @@ function refreshRoundedCorners(actor: ExtensionsWindowActor): void {

/** Refresh rounded corners settings for all windows. */
function refreshAllRoundedCorners() {
global.get_window_actors().forEach(refreshRoundedCorners);
for (const actor of global.get_window_actors()) {
refreshRoundedCorners(actor);
}
refreshAllShadows();
}

0 comments on commit 98096c7

Please sign in to comment.