stackline icon indicating copy to clipboard operation
stackline copied to clipboard

Trick — Reduce redraw lag when switching spaces

Open devnoname120 opened this issue 1 year ago • 0 comments

Add the following in ~/.config/yabai/yabairc:

yabai -m signal --add event=space_changed action="hs -A -c 'stackline.manager:update({forceRedraw = true})'"

Optional — comment out these lines to avoid a double redraw: https://github.com/AdamWagner/stackline/blob/215b35d383a6d120e9969415d4b6c29bde0cac81/stackline/stackline.lua#L146-L156

Why: It may be because hs.spaces.watcher() is using a macOS API that is deprecated since macOS 10.8. It always returns -1 as a space id to the callback on newer macOS versions[1].

See https://github.com/Hammerspoon/hammerspoon/issues/3250

See https://github.com/AdamWagner/stackline/issues/110 for another performance trick.


[1] Confirmed on macOS Monterey 12.4.

devnoname120 avatar Aug 19 '22 11:08 devnoname120