lwouis / alt-tab-macos

Windows alt-tab on macOS
https://alt-tab-macos.netlify.app
GNU General Public License v3.0
10.13k stars 315 forks source link

Doc: add that Finder process is required for the app to ask for screen recording permissions #2074

Open eugenesvk opened 1 year ago

eugenesvk commented 1 year ago

On Catalina (and maybe other versions) your great app doesn't ask for the screen recording permissions (and it's impossible to add any app manually, the app has to request it) unless the Finder process is running. Since I'm using a different default file manager, I struggled for a while trying to google/remember (memory won this time :)) how to fix the issue of the app not asking for this type of permissions.

Would you please add a short note to the prompt window that Finder is required for the app to ask for the screen recording permissions (another would could be that sometimes this stupid permission window gets buried in the background and you'd need to hide other windows manually to see it and click to allow)?

lwouis commented 1 year ago

Hi @eugenesvk

I'm trying to understand better your situation. So AltTab shows you its window asking for the 2 different permissions. Here you click on "Screen Recording". You say that at this point, it sends you to System Preferences in the Screen Recording list, but you don't see AltTab listed? And you say it wasn't listed because you don't have Finder running?

I'm confused when at the end you say "this stupid permission window gets buried in the background". Isn't that implying that you correctly got prompt even with Finder disabled?

It would help a lot to share a video showcasing the whole flow, so we understand better the steps.

A side-note: I'm on Ventura, and you can add apps to Screen Recording now. I wonder if it was added in Monterey or Ventura.

eugenesvk commented 1 year ago

Here you click on "Screen Recording". You say that at this point, it sends you to System Preferences in the Screen Recording list, but you don't see AltTab listed?

Yes, it doesn't add anything to the list

And you say it wasn't listed because you don't have Finder running?

Not exactly, it wasn't listed because your app didn't ask for these permissions, so it wasn't added to the list, it only sent me to the System Preferences. If Finder is running, then the app also shows this extra window asking for permissions (though this window is useless if I use your main window, open the preferences and click the checkark to allow, then even if I click Deny on this window, nothing happens)

1

I'm confused when at the end you say "this stupid permission window gets buried in the background". Isn't that implying that you correctly got prompt even with Finder disabled?

No, it's a separate issue.

eugenesvk commented 1 year ago

It would help a lot to share a video showcasing the whole flow, so we understand better the steps.

Without Finder — no 2nd window asking for permissions (so, no app in the list (the last part is not in the video) https://user-images.githubusercontent.com/12956286/199578379-d99eafb4-c0e2-429e-9a10-548d4f366104.mov

With Finder — you get the two windows, your app's and OS's native window asking for permissions and the app appears in the preferences list https://user-images.githubusercontent.com/12956286/199578391-4252c4d8-170e-431f-a890-cc8393524c90.mov

(though this time the 2nd window is on top, it often get's buried in the background, leading to a potential discoverability issue, so might also be worth it mentioning in your window's description, though it's a minor issue since the user will just click a checkbox following your helper instead)

lwouis commented 1 year ago

Ok I understand better. Let me share some data with you.

There is no public API to add an app to the Screen Recording list. It's a typical situation in the Apple ecosystem.

The only way to add an app to the list is to use an API that would get you something forbidden, like ask for a screenshot of a window. That makes the OS prompts the user for permission via the small dialog that easily gets lost. That's why AltTab has this bad UX of having a nice window with buttons that send you in the right places to grant permissions, and also the small OS window. We can't add AltTab to the list without prompting the window. It's actually more complex. We use a private API, and other tricks.

The issue with not having Finder running is definitely niche, but it would be nice to support it. I don't think adding a message is the way to go though. It would confuse normal users, while being missable by the few who are concerned.

Maybe we could detect that Finder is not running, then launch it, trigger the prompt, then kill it. I wonder if the prompt dies with Finder or not. Alternatively, we could detect that Finder is not running, and show a dialog before the permission dialog, which says to run Finder otherwise it doesn't work.

Finally, we could look into a trick to list the app without finder running. There probably is a clever trick to do it.

lwouis commented 1 year ago

I just tried to launch AltTab with the Finder not running, and it showed me the prompt, and added AltTab to the Screen Recording list. Maybe it works on Ventura but not on Catalina? That's a problem because I probably won't have acces to a mac with Catalina in the near future.

eugenesvk commented 1 year ago

Have you removed all traces of the app from your system before testing? I had to use Remove-It to do a clean uninstall to replicate, I think once you've registered it once, you don't need Finder anymore even if you delete permissions But on a clean install it bugs

I'm, of course, not against any advanced smart fixes, that's just more complicated vs a simple warning, so didn't even try to suggest trying to detect Finder

lwouis commented 1 year ago

Here is what I did:

Either Apple made permissions work without a need for Finder in recent macOS version, or something is not what it seems on your side.

As a test, could you try to run another app that requires Screen Recording permissions, with the Finder quit. If you hypothesis is correct, then no app should work here. It shouldn't just be AltTab. You could try HyperSwitch for instance.

eugenesvk commented 1 year ago

Here is what I did:

Try to add

Remove permissions in System Settings (somehow, they remained after Remove-It removed all files)

Did you refresh the settings list? I think it does remove permissions as well (at least with today's test with ScreenFlow Remove-It did remove permissions, but required to go to another settings tab and then back to refresh the list)

As a test, could you try to run another app that requires Screen Recording permissions

All my screen recording permissions apps were this test! That's how I had the memory of this fix. They all fail, just tried an app I haven't had installed — ScreenFlow — same thing: it opens the preferences, but doesn't pop the 2nd window and doesn't add itself to the list. Closing the app and, launching Finder and opening the app fixes it — I get the 2nd window and the app is added to the list

You could try HyperSwitch for instance

This didn't even launch without Finder after two 'malicious' prompt fixes, so I've tested with another app — ScreenFlow, see above Can you try ScreenFlow on your system (unless you've also had it installed in the past, so the settings would persist) so that we know whether

Either Apple made permissions work without a need for Finder in recent macOS version

is true (I hope it is)