-
Notifications
You must be signed in to change notification settings - Fork 595
Subscribing to hs.window.filter.windowUnfocused does not trigger in app #2400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
AdamWagner
added a commit
to AdamWagner/stackline
that referenced
this issue
Aug 10, 2020
…ndicators update when switching between windows of the same app.
Thanks for reporting. The behavior described is easily reproducible and is a significant deviation from expected behavior. I would bet that a recent change introduced a regression? |
|
AdamWagner
added a commit
to AdamWagner/stackline
that referenced
this issue
Aug 22, 2020
* format: auto-formatted per luaformat config. Functions folded with 'set fdm=marker' in vim * WIP: Working toward addressing #8 in stackline/query.lua, which replaces bin/yabai-get-stacks. The goal of this file is to eliminate the need to 'shell out' to yabai to query window data needed to render stackline, which would address #8. The main problem with relying on yabai is that a 0.03s sleep is required in the yabai script to ensure that the changes that triggered hammerspoon's window event subscriber are, in fact, represented in the query response from yabai. There are probably secondary downsides, such as overall performance, and specifically *yabai* performance (I've noticed that changing focus is slower when lots of yabai queries are happening simultaneously). ┌────────┐ │ Status │ └────────┘ We're not yet using any of the code in this file to actually render the indiators or query ata — all of that is still achieved via the "old" methods. However, this file IS being required by ./core.lua and runs one every window focus event, and the resulting "stack" data is printed to the hammerspoon console. The stack data structure differs from that used in ./stack.lua enough that it won't work as a drop-in replacement. I think that's fine (and it wouldn't be worth attempting to make this a non-breaking change, esp. since zero people rely on it as of 2020-08-02. ┌──────┐ │ Next │ └──────┘ - [ ] Integrate appropriate functionality in this file into the Stack module - [ ] Update key Stack module functions to have basic compatiblity with the new data structure - [ ] Simplify / refine Stack functions to leverage the benefits of having access to the hs.window module for each tracked window - [ ] Integrate appropriate functionality in this file into the Core module - [ ] … see if there's anything left and decide where it should live ┌───────────┐ │ WIP NOTES │ └───────────┘ Much of the functionality in this file should either be integrated into stack.lua or core.lua — I don't think a new file is needed. Rather than calling out to the script ../bin/yabai-get-stacks, we're using hammerspoon's mature (if complicated) hs.window.filter and hs.window modules to achieve the same goal natively within hammerspon. There might be other benefits in addition to fixing the problems that inspired tracked by stackline, which will probably make it easier to implement enhancements that we haven't even considered yet. This approach should also be easier to maintain, *and* we get to drop the jq dependency! * WIP: basic working state with lots of cruft to clean up and edge cases to fix * Bring over some changes from #13 * Bring over indicator styling improvements from #13 * Move self.colorOpts into Window:drawIndicator() so that the latter can be called in place of Window:process() to redraw a window. * A small bit of much-needed cleanup * Basic functionality working well. Parameterized display options. Indicators display on left/right edge of window based on which side of the screen the window resides. Known bug: changes broke multiple stacks on the same space. * Fixed issue where only 1 of N stacks responded to focus events. Moved all stack-is-occluded functionality from Query to StackMgr and Stack modules. * Workaround hammerspoon bug (Hammerspoon/hammerspoon#2400) to ensure indicators update when switching between windows of the same app. * Fold Window:getScreenSide() * Modifying existing indicators on focus change is MUCH faster than destroying them & rendering from scratch. * Cleanup (one of the) utils.lua files * Add a status update to readme describing recent changes * Included a bunch of cleanup/reorg changes missed in last commit * Fix path to dash shell (again) * Add hs._asm.undocumented.spaces dependency * Remove unused StackConfig:handleSignal() method (it needs to be available outside of class) * Cleanup comments & delete unused bluclass.lua * Don't use hs._asm.undocumented.spaces. Uncomment window.filter.notInCurrentSpace which depends on it.' * Fill gap left behind by hs._asm.undocumented.spaces with hs.spaces.watcher * Increase threshold in window:getSide() to fix issue w/ large yabai padding values * Cleanup comments in query.lua * Removed hs._asm.undocumented.spaces from list of dependencies * Delete unused utils, consolidate utils into single file. * Track stack focus state, indicate last-focused window in unfocused stack, and centralize indicator config settings & retrieval. * Fix misleading comment * Remove garbage characters in comment * Fix error stackline/window.lua:95: attempt to perform arithmetic on a nil value (field 'stackIdx') by checking for stackIdx > 0 * Remove completed TODO comments, try to keep TODO comments on single line to work well with leasot / rg * Enable keybindings in init.lua by returning stackConfig & stackManager instances from main stackline.lua Remove keybinding from config.lua & move to readme. * Fix #21 - Limit stack left/right edge to screen boundary so it doesn't go off screen * Update version to 0.1.50
This was referenced Oct 4, 2020
Bumping this, any updates on this? still an issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed that the behavior of subscribing to
hs.window.filter.windowUnfocused
is different from subscribing tohs.window.filter.windowFocused
, when switching windows within one application.hs.window.filter.windowUnfocused
does trigger only when changing windows between applications, e.g. from Terminal to Mail, but not e.g. when moving focus from one terminal window to another.hs.window.filter.windowFocused
rightfully does trigger both across applications and in application, e.g. moving focus from one terminal window to another triggers the subscription. This should be expected behavior for both cases.Hammerspoon Version 0.9.78 (5164) on macOS 10.14.6
The text was updated successfully, but these errors were encountered: