Created
January 12, 2024 04:36
-
-
Save SethMilliken/3cc3255c1ff45965839ade7b803f9ad8 to your computer and use it in GitHub Desktop.
Hammerspoon AXEnhancedUserInterface issue workaround
This file contains 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
function windowMoveFunction(window, screen, rect) | |
hotfix = axHotfix(window) | |
window = hotfix:window() | |
window:moveToScreen(screen) | |
window:moveToUnit(rect) | |
hotfix:revert() | |
end | |
-- cf. https://github.com/Hammerspoon/hammerspoon/issues/3224 | |
function axHotfix(win) | |
if not win then win = hs.window.frontmostWindow() end | |
local axApp = hs.axuielement.applicationElement(win:application()) | |
local wasEnhanced = axApp.AXEnhancedUserInterface | |
if wasEnhanced then | |
print("AXEnhancedUserInterface was true for window: forced false") | |
axApp.AXEnhancedUserInterface = false | |
end | |
hotfix = {} | |
function hotfix:window () | |
return win | |
end | |
function hotfix:revert () | |
axApp.AXEnhancedUserInterface = wasEnhanced | |
print(string.format("AXEnhancedUserInterface for window: %s", wasEnhanced)) | |
end | |
return hotfix | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment