Skip to content
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

Maximize Character Gesture Behaves Differently on Two Machines #19

Closed
elstgav opened this issue Mar 19, 2022 · 9 comments · Fixed by #32
Closed

Maximize Character Gesture Behaves Differently on Two Machines #19

elstgav opened this issue Mar 19, 2022 · 9 comments · Fixed by #32

Comments

@elstgav
Copy link

elstgav commented Mar 19, 2022

So glad to see Jitouch back! 🎉. Thank you for working on this 🙏🏻.

I just installed Jitouch on my work and home laptops, and am seeing different behavior on them. On my home laptop, a MacBook Pro 15-inch, 2016, when I use the character gestures to maximize windows left or right, they snap instantly. And frustratingly, the gesture doesn’t work on Chrome windows.

However, on my work laptop, a 16-inch 2019 MacBook Pro, when I use the gestures, windows smoothly animate to their new position, and Chrome windows work just fine. What’s the expected behavior here? Are windows expected to smoothly transition between maximize states?

@elstgav
Copy link
Author

elstgav commented Mar 20, 2022

Update: The Chrome issue gets weirder; I can use the maximize gesture on blank new windows/tabs. But as soon as I go to any website or open a settings pane, I can no longer use the maximize gesture 🤔

@aaronkollasch
Copy link
Collaborator

Hmm, yeah I do see the second issue - resize gestures aren't working on Chrome after navigating to a new site. The character gesture itself seems to be detected. It's possible Jitouch is getting the wrong window with getForemostApp().

On my 2021 MBP I don't see a smooth animation, just snapping. It may be OS-determined behavior, based on this call to AXUIElementSetAttributeValue: https://github.com/aaronkollasch/jitouch/blob/c722b388ee3e9eada1fc451a84a80fb8246a63cb/jitouch/Jitouch/Gesture.m#L257-L265

@ONEKENO
Copy link

ONEKENO commented Aug 22, 2022

Hello,

Any solution for resized gestures aren't working on Chrome?

Thanks

@aaronkollasch
Copy link
Collaborator

aaronkollasch commented Aug 22, 2022

tl;dr: To get gestures working on Chrome for now, go to chrome://accessibility and check the boxes "Native accessibility API support" and "Web accessibility". This may need to be done after every relaunch.

image

So my Google Chrome wasn't working with the Maximize gestures, but then I navigated to chrome://accessibility and the gestures started working.

The issue was getForemostApp() returning null when AXUIElementCopyAttributeValue() of kAXFocusedApplicationAttribute returned kAXErrorNoValue; function linked below.

https://github.com/aaronkollasch/jitouch/blob/2c45eedf06bd2e82b00e9b93c8e8bebc8e3d0c09/jitouch/Jitouch/Gesture.m#L212

Therefore, I suspect Google Chrome may have been hiding itself from the accessibility API by default. See this stackoverflow answer for another instance of this behavior.

Just visiting the accessibility page seems to have fixed it for me, and now I can't get gestures to stop working, even if I uncheck all the accessibility features. Let me know if that fixes things for you.

Edit: reinstalling Chrome made gestures stop working, and going to chrome://accessibility alone didn't fix them. They only started working when I checked both "Native accessibility API support" and "Web accessibility".

Annoyingly, I'm not sure that Google Chrome remembers these settings after a relaunch. However, those permissions are required for Jitouch to do its job with the APIs it currently uses, so there's no way around them other than rewriting the window control code using some other API.

Edit 2: It looks like Chrome turns on accessibility support only when the AXEnhancedUserInterface attribute is set [link], so there may be some Chrome-specific tweaks that will enable things by default. Related issues: rxhanson/Rectangle#165 kasper/phoenix#301

@ONEKENO
Copy link

ONEKENO commented Aug 24, 2022

The gesture works after checking the boxes "Native accessibility API support" and "Web accessibility" but after restarting the browser the checkings are gone and also gesture stops working. Is there any way to save the checking after relaunch?
It's the same with Brave.
Thanks.

@aaronkollasch
Copy link
Collaborator

It looks like actually a simple fix, I'll include it in the next beta.

@aaronkollasch
Copy link
Collaborator

Beta now released at https://github.com/aaronkollasch/jitouch/releases/tag/v2.82-beta.2. Let me know if it works.

@ONEKENO
Copy link

ONEKENO commented Aug 25, 2022

Beta now released at https://github.com/aaronkollasch/jitouch/releases/tag/v2.82-beta.2. Let me know if it works.

It's now working very well even after relaunching the browser. Well done. Thank you very much.

@aaronkollasch
Copy link
Collaborator

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants