Open cfal opened 3 years ago
This sounds like it's probably a result of the AXEnhancedUserInterface
property getting enabled. AXEnhancedUserInterface
is mostly a VoiceOver thing, but Keyboard Viewer - which got reworked into the Accessibility Keyboard at some point - seems to set it to true as well. Unfortunately, it has some weird side effects, like adding animations when you try to move/resize anything through the Accessibility API - and canceling those animations halfway through if you try to do a move immediately followed by a resize. See https://github.com/Hammerspoon/hammerspoon/issues/3224#issuecomment-1294359070 and replies for more info and workarounds.
Edit: I actually keep this function in my config so that I can clear that property after using the Keyboard Viewer:
function zapEnhancedUserInterface()
for _, app in ipairs(hs.application.runningApplications()) do
local ax = hs.axuielement.applicationElement(app)
if ax.AXEnhancedUserInterface then
print(app:name())
ax.AXEnhancedUserInterface = false
end
end
end
Possibly related to https://github.com/Hammerspoon/hammerspoon/issues/2316 since it looks like it's related to animations, but Keyboard Viewer is not an electron app. Keyboard Viewer is the native MacOS on-screen keyboard which you can open from Accessibility or from "Show Keyboard Viewer" if you have the input icon in your menubar.
To reproduce:
local function right_half() local rect = hs.screen.mainScreen():frame() rect.x = rect.w / 2 rect.w = rect.w - rect.x hs.window.focusedWindow():setFrame(rect, 0) end