Fix stack icon rendering on newer macOS#131
Open
kiwidream wants to merge 2 commits intoAdamWagner:mainfrom
Open
Fix stack icon rendering on newer macOS#131kiwidream wants to merge 2 commits intoAdamWagner:mainfrom
kiwidream wants to merge 2 commits intoAdamWagner:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix stack indicators not showing app icons on newer macOS/Hammerspoon setups, and add a small local Lua test harness to cover the new behavior.
Fixes #125.
Problem
On current Apple Silicon and newer macOS/Hammerspoon environments, Stackline could fail to display stack icons for two different reasons:
paths.yabaicould point at a Homebrew prefix directory such as/opt/homebrew/opt/yabaiinstead of the actual binary, which caused thehs.tasklaunch to fail and leftstackmanagerempty.hs.window.filter:getWindows()to expose every stacked window. On newer setups that assumption appears less reliable, so Stackline could miss stacked windows before it ever reached the icon drawing path.hs.appfinder.appFromName(), which is deprecated and can returnnilin cases where the owning application object is already available from the window.The net effect was that users could create a stack successfully but see no icon indicators, with very little diagnostic information about which layer had actually failed.
Solution
This PR hardens the stack detection and icon lookup paths:
stack-indexvalues and drop grouped windows that yabai does not report as stackedhs.window.filterdoes not expose all stacked windowshs.application.get()as neededpaths.yabaiconfig to prefer/opt/homebrew/bin/yabaiwhen presentAdditional Changes
This PR also adds a lightweight local Lua test harness so the new behavior can be exercised without requiring a full interactive Hammerspoon session:
make testentrypointTesting
Manual:
~/.hammerspoonhsCLI after enablinghs.ipcpaths.yabaito/opt/homebrew/bin/yabaiAutomated:
make testCurrent result:
6 tests, 0 failures