-
Notifications
You must be signed in to change notification settings - Fork 33
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
Prevents Yabai from working correctly. #45
Comments
Hi @BlueDrink9 I certainly do hook into the Accessibility API, but not really in a tiling window kind of way. I'm mostly doing things like:
See these files: https://github.com/dbalatero/VimMode.spoon/blob/master/lib/strategies/accessibility_strategy.lua for ways I'm using it. Is this happening purely because VimMode is running in the background, or is it happening on certain key presses? Like are you in Vim normal mode when the yabai windows break? Or are you not even interacting with the Vim plugin. Can you record a screen capture video and upload it here, maybe with your keypresses? Also to look at, when Accessibility APIs are not giving me what I need, i fallback to issuing key presses. Again, this is only relevant if you're in Vim normal mode. https://github.com/dbalatero/VimMode.spoon/blob/master/lib/strategies/keyboard_strategy.lua Finally, is there anything interesting in the Hammerspoon console logs to share? |
Not even interacting with it, not in normal mode. So it seems to be just running in the background. Here's my config: local VimMode = hs.loadSpoon('VimMode')
local vim = VimMode:new()
-- vim:enterWithSequence('kv')
vim:bindHotKeys({ enter = {{'ctrl'}, '['} })
-- Check activity monitor for app names.
vim
:disableForApp('Code')
:disableForApp('iTerm')
:disableForApp('kitty')
:disableForApp('MacVim')
:disableForApp('Terminal')
:disableForApp('nvim')
-- Show alert when entering normal mode
vim:shouldShowAlertInNormalMode(true)
vim:shouldDimScreenInNormalMode(false) Console log shown in video, doesn't look like anything is happening there. Ignore the texshop thing, accidentally opened that just after starting hammerspoon. Closing hammerspoon doens't immediately fix it, but closing hammerspoon then restarting the terminal app does. Keybindings being used are The start of the recording shows opening new terminal windows with hammerspoon open (having loaded this spoon). The windows do not tile into their correct locations, although yabai resizes windows around them to make room. Instead, the windows are put into default locations, as if they were floating above other windows, which is why they cover up the console window on the left. Then, I close hammerspoon, restart my terminal app, and open several windows again. This time you can see that new windows tile correctly when they open, even if I close windows and reopen them. |
Hmm, the gif is really distorted and I can't read. I'm also confused about what's happening. Can you maybe go into detail about what you expect to see, and what you're seeing happening instead? Also, could you maybe just paste the Hammerspoon logs? Instead of having them as a few frames in the video? |
Sure, sorry. The logs are very nondescript.
I've updated the commetn with the screen recording to show a description of what's doing on. |
Out of curiosity, what happens if you switch this line to be false? vim:shouldShowAlertInNormalMode(false) Also, what happens if you disable the Vim plugin, but keep the same key binds, binding them to something simple like: hs.hotkey.bind({'ctrl'}, "[", function()
hs.alert.show("hi")
end) Also, is there a verbose mode you can put |
Another thing I notice is that yabai's tiling happen more slowly (in terms of frame-by-frame change in window size/position) running this compared to when hammerspoon is closed.
Binding the hotkey while disabling the plugin with this made no difference to just disabling the plugin (issue remained absent)
Looking at verbose yabai/skhd now |
Verbose logs from yabai without hammerspoon and this plugin: Click to expand
Verbose logs from yabai with just hammerspoon, without this plugin: Click to expand
Verbose logs from yabai with hammerspoon and this plugin: Click to expand
From what I can see, the only difference is that we get a lot more The logs show 'recieved keybindings' in the form of whatever
( |
@koekeishiya might have more to say about them? |
@BlueDrink9 ok, one thought: What happens if you comment out this line (the call to Line 69 in 2bf4944
I'm wondering if the accessibility patching I'm doing is screwing up yabai. |
Could well be. Testing now |
That does seem to have helped, although not entirely. With that line commented out, it seems that if hammerspoon is started while the app to be tiled (eg kitty) isn't running, then kitty is started, it tiles fine. |
See koekeishiya/yabai#524 for details about how it stops Yabai working.
Running hammerspoon without this script enabled is fine, reloading config with this script enabled causes the issue again.
It has worked in the past, so I don't know what has changed.
I have no idea how to go about diagnosing which part of this spoon is causing the issue. Does it mess with accessibility settings or window controls at all?
The text was updated successfully, but these errors were encountered: