JitouchApp / Jitouch

A multi-touch extension for MacBook, Magic Mouse, and Magic Trackpad
GNU General Public License v3.0
391 stars 28 forks source link

Fix window gestures for chromium-based apps #32

Closed aaronkollasch closed 2 years ago

aaronkollasch commented 2 years ago

By default, chromium-based apps will return kAXErrorNoValue for AXUIElementCopyAttributeValue(systemWideElement, kAXFocusedApplicationAttribute, ...). This prevents window gestures from working on Google Chrome and Electron apps such as Spotify.

In case of an error from AXUI, instead get the frontmost application from [NSWorkspace sharedWorkspace] and proceed with getForemostApp().

AXUIElementCopyAttributeValue could probably be replaced entirely, but I will leave it in case AXUIElementCopyAttributeValue is preferred in some cases.

Fixes #19