lwouis / alt-tab-macos

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

macOS Sonoma shows an icon in the menubar with "AltTab is sharing your screen" #2606

Closed 5cj closed 11 months ago

5cj commented 1 year ago

Describe the bug

Alert on boot after updating to Sonoma Developer Beta (14.0):

Alert "AltTab" is using a deprecated API that will be removed in the future. Please contact the developer for an updated version.

Screenshots / video

image

Steps to reproduce the bug

  1. Update to Sonoma Developer Beta
  2. Start AltTab
  3. Observe alert

Your environment

lockieluke commented 1 year ago

In the menu bar there’s also an icon indicating that AlrTab is actively monitoring your screen which the icon was not there before the beta 2 update possibly due to newly deprecated APIs

5cj commented 1 year ago

In the menu bar there’s also an icon indicating that AlrTab is actively monitoring your screen which the icon was not there before the beta 2 update possibly due to newly deprecated APIs

98FCB2AA-499F-4307-85BB-01C6479D22CC_4_5005_c

Screenshot for context, can't find a way to disable or hide it. Unsure if it warrants a separate issue, they may be related.

ajnart commented 1 year ago

Same issue here. I've updated to the latest update but have this icon constantly

lwouis commented 1 year ago

I already closed these duplicates:

This time, I'll keep this ticket open so people can hopefully see it and stop creating new tickets.

Now regarding the topic itself: a beta is unstable software. Let's wait for Sonoma to go live to discuss if there are things to deal with, for AltTab. Hopefully by then, Apple will have fixed their issues.

lockieluke commented 1 year ago

Interesting take on the issue, a developer beta is for developers to first optimise and fix their apps for the upcoming releases instead of starting to work on it after public release drops

lwouis commented 1 year ago

@lockieluke previous macOS beta have introduced similar issues in the past, which they then fixed before the end of the beta. That's what I mean by unstable. Apple develops the OS actively during the beta. For Sonoma, it seems they are working on various UIs to share info about the app to the users. These UI elements look obnoxious and most big apps would display it, so I wouldn't be surprised that it all goes away before the end of the beta.

Please keep in mind #1179. I want to minimize the work on AltTab's side, so it makes sense to wait for Apple to be done moving things around until I try my best at fixing what they broke.

5cj commented 1 year ago

Please keep in mind #1179. I want to minimize the work on AltTab's side, so it makes sense to wait for Apple to be done moving things around until I try my best at fixing what they broke.

Fair, but closing issues typically delays progress, especially in a situation like this where it seems Apple is providing a notice.

For anyone looking for a place to start, I think the deprecated method may be 'activate(ignoringOtherApps:)', though I'm not super confident that's solely responsible for the alert since I have minimal exposure to AppKit development. I found that Apple's documentation has it listed as deprecated in 14.0, and it appears in the codebase a few times.

ghost commented 1 year ago

This appears to be an intentionally deprecated API, not a bug. In fact, it was already deprecated in Ventura, but it could still be used if your app targets a lower version.

ATS and ATSUI

Deprecations

Starting macOS 14 Sonoma, whenever the OS detects the usage of ATS or ATSUI APIs, the user will be presented a dialog stating that the application needs to be updated. Once the dialog is dismissed by the user, the application will exit. (100521621)

https://developer.apple.com/documentation/macos-release-notes/macos-14-release-notes#ATS-and-ATSUI

flexlixrup commented 1 year ago

I guess the screen sharing and the deprecated method are 2 different issues. The deprecated API, which throws the error popup has to be fixed before public release of macOS 14. The issue with the screen sharing could be tuned on Apples side before fall. I suggest opening 2 seperate issues on these topics.

Regarding the deprecated method: macOS 14 introduces a new 'activate()' method without the flag. The behavior has to be checked as the documentation is minimal but if I would have to guess, ignoringOtherApps is set to false on this new method, so if it changes the behavior of the App, a workaround has to be implemented in time.

zacharee commented 1 year ago

It might be possible to use NSApplicationDelegate.yieldActivation(to: NSRunningApplication) before activate() when switching windows, where the NSApplicationDelegate is the app set to be unfocused.

Edit: strike that. There are only NSRunningApplication references for other apps.

zacharee commented 1 year ago

There's a hidden API that supposedly has the same functionality as the deprecated activate() API, so I put up a PR implementing it: https://github.com/lwouis/alt-tab-macos/pull/2620.

fifafu commented 1 year ago

I have also faced the deprecated API message in my app BetterTouchTool. I'm pretty sure it's not caused by the activateIgnoringOtherApps method. Way too many apps are using that method to just deprecate and remove it like this. Currently the best guess is the CGDisplayStreamCreate API, which is also used in AltTab to check screen recording permissions.

koekeishiya commented 1 year ago

I believe you should be using func CGPreflightScreenCaptureAccess() -> Bool to check for access, and func CGRequestScreenCaptureAccess() -> Bool to request access if it is not granted already, to manage screen recording permissions.

https://developer.apple.com/documentation/coregraphics/3656523-cgpreflightscreencaptureaccess https://developer.apple.com/documentation/coregraphics/3656524-cgrequestscreencaptureaccess

fifafu commented 1 year ago

Yes, but this API is not a full replacement. It doesn't update while the app is started and also it is incorrectly marked as available on macOS 10.15 - which will just crash your app if you try to use it on that macOS version.

lwouis commented 1 year ago

Absolutely. I tried to use it in the past as it looks on paper like the proper way to do things, but the hacky alternative we use today is more robust and more flexible.

caffeinum commented 1 year ago

Not sure if it grants a separate issue, but on MacOS Sonoma, they've also updated UI for a language switcher.

For some reason, AltTab detects it as a separate window, and shows in the app list. It doesn't go away ever, once you switch a language this way once.

lwouis commented 1 year ago

Hi @caffeinum,

There was an issue with the new language-switch UI. They fixed it in a later beta release. They will probably continue working on / fixing this feature. Let's review it when Sonoma goes live.

Rithari commented 1 year ago

I believe it is safe to say that the issues can be addressed now, seeing as Sonoma goes public Sept. 18th.

lwouis commented 1 year ago

I tried to create a VM of the Release Candidate 2:

image

I couldn't get it to start. This means that I'll only be able to experience Sonoma after it's released. Only then, will I be able to observe the issue, and potentially change the app to improve things, if it can be done.

If anyone on Sonoma has an improvement to share, please share a PR and I'll do my best to review it 👍

rami3l commented 1 year ago

@lwouis Don’t worry, the official stable release will arrive within this week :)

ShlomoCode commented 1 year ago

@lwouis You can easily upgrade by searching in the System Settings "Software Update" and then click on the icon next to "Beta updates" and choose "macOS Sonoma Developer Beta" and OK, then you will have the option to upgrade with the click of a button to macOS sonoma (I myself used this method successfully a few days ago) CleanShot 2023-09-25 at 19 44 58@2x

ventsislavnikolov commented 1 year ago

Hi, I'm currently using the RC2 of Sonoma as you can see in the screenshot and I still have the notification for AltTab is recording your screen, just to confirm. And its annoying :)

image
lwouis commented 1 year ago

Anyone knows what this new UI is meant to do?

AltTab needs Screen Recording permissions for its operations. Without it, we can't get screenshots of the windows to show the user. We can't even get the window names.

This new UI seems to imply that we are constantly recording the screen, which is not the case. We take screenshots of windows when they change (resized, moved, minimized, etc).

I don't understand what the idea is with this new UI. Maybe it's intended that AltTab is shown there? Maybe Apple's implementation shouldn't trigger here since we are not constantly recording like a video stream? Is there any documentation from Apple somewhere which explains their intent with this new UI system?

fifafu commented 1 year ago

I think Apple intents for it to be like this. It goes away after a while when not doing any screen captures for some time. There is no (non-hacky) way to hide that UI, it's part of the Control Center process.

Accessing meta information about windows does not trigger the icon to be shown though (at least in my apps), AFAIK it's just real captures that make it show up.

It's stupid, there should at least be an option to exclude apps from it - especially as it doesn't improve security at all. However this is feedback that needs to go to Apple. I filed it as FB13205878

ShlomoCode commented 1 year ago

This new UI seems to imply that we are constantly recording the screen, which is not the case. We take screenshots of windows when they change (resized, moved, minimized, etc).

Why not just when pressing the alt-tab shortcut?

lwouis commented 1 year ago

@ShlomoCode AltTab is refreshing thumbnails when windows move, so that when the user summons it, it can display in the next few frames, with accurate content. We can't capture every change (e.g. a Youtube video playing), so we'll still refresh thumbnails after AltTab shows. But we have something accurate to show right away. Then we update thumbnails one by one from the first to the last. It's typically invisible since often all thumbnails are already up to date.

So in short, we do that to provide the best UX. AltTab aims at being as responsive as it is on Windows, which is a high target to aim at.

Rithari commented 1 year ago

Sonoma is available starting today.

https://www.apple.com/newsroom/2023/09/macos-sonoma-is-available-today/

mikluko commented 1 year ago

Screen recording icon in control center is tremendously annoying. I know there is probably nothing that can be done on the developer side but I can't afford attention drain like that.

😭 I hate to do that but I have to abandon AltTab.

hvmzx commented 1 year ago

Screen recording icon in control center is tremendously annoying

Got the same issue with the stable release of Sonoma, quite annoying...

emirrou commented 1 year ago

Screen recording icon in control center is tremendously annoying. I know there is probably nothing that can be done on the developer side but I can't afford attention drain like that.

😭 I hate to do that but I have to abandon AltTab.

You can also check the option "Hide window thumbnails" which stops showing the screen recording icon. Makes AltTab still work just fine :)

mauricego commented 1 year ago

It seems like this has something to do with the used API. There should be a new API which doesn't have this problem.

rami3l commented 1 year ago

alt-tab is not alone in this situation though. With certain options turned on, Bartender 5 is doing the same.

Rithari commented 1 year ago

alt-tab is not alone in this situation though. With certain options turned on, Bartender 5 is doing the same.

Might be worth talking to their development team to see what they've come up with considering Bartender 4 faced the same issues by default.

Edit: It looks like they've straight up opted for a different approach and have not in fact come up with a solution to the screen recording issue.

ldclassic commented 1 year ago

Maybe also checkout the window switcher in BetterTouchTool (predefined action "Show Window Switcher For All Open Apps"). It seems to be able to show thumbnails of windows without triggering the screen recording icon (also in general seems to have similar functionality to AltTab).

lwouis commented 1 year ago

Everyone keeps calling the UI an "issue". As far as i understand, it's exactly what Apple wants: make people extra aware of apps capturing their screen or windows.

i think it's a feature not a bug, and people who don't like to be notified so boldly may want to turn to Apple. Apple designed this warning UI. It seems to me it's behaving exactly as they intended. AltTab can't control what Apple does here

Rithari commented 1 year ago

I believe it to be an issue effectively because this change will make people not want to use great apps such as AltTab or Bartender (although the latter mitigated the issue by providing a viable alternative) and disabling the thumbnails might not be everyone's cup of tea, myself included. There is not really any alternative that springs to mind either so it really is a shame.

That being said, I do agree that it's just an Apple being Apple thing and hardly your fault here.

starcraft66 commented 1 year ago

@lwouis While I mostly agree with your sentiment and the spirit of the feature, by not allowing users to disable it for certain apps or altogether, Apple is just subjecting its users to alert fatigue. If this indicator is supposed to alert me of privacy problems, but is firing up with a 99.99% false-positive rate, I will just start ignoring it and not notice any privacy problems it should actually be alerting me of.

Duc-NSH commented 1 year ago

@lwouis While I mostly agree with your sentiment and the spirit of the feature, by not allowing users to disable it for certain apps or altogether, Apple is just subjecting its users to alert fatigue. If this indicator is supposed to alert me of privacy problems, but is firing up with a 99.99% false-positive rate, I will just start ignoring it and not notice any privacy problems it should actually be alerting me of.

Totally agree with you, hope that Apple will bring an option to disable the warning for specific applications. Currently, I have to disable the thumbnail temporarily :(

ourcore commented 1 year ago

To me, it's not a big enough dealbreaker to disable thumbnails since it only appears in the menu bar temporarily, I just wish I could at least hide it with other icons, but like others have said, it appears to be doing what Apple intended and hiding it would probably require a hack-y solution. Apple would never let users disable it

ShlomoCode commented 1 year ago

You can drag it using command beyond the visible amount of icons (if you have many apps with an icon in the menubar)

ghost commented 1 year ago

I'm going to unsubscribe from this thread as my email inbox is being flooded by irrelevant discussion repeating the same things over and over again that doesn't contribute to resolving the issue.

ourcore commented 1 year ago

The point of the discussion is that there might not be an issue to resolve...

mikluko commented 1 year ago

You can also check the option "Hide window thumbnails" which stops showing the screen recording icon. Makes AltTab still work just fine :)

For me like 90% of app value was exactly window previews. Without them built-in switching works better at my taste.

mikluko commented 1 year ago

Everyone keeps calling the UI an "issue". As far as i understand, it's exactly what Apple wants: make people extra aware of apps capturing their screen or windows.

i think it's a feature not a bug, and people who don't like to be notified so boldly may want to turn to Apple. Apple designed this warning UI. It seems to me it's behaving exactly as they intended. AltTab can't control what Apple does here

From purely engineering standpoint you are right since everything works as intended and expected. But from usability standpoint it is a degradation of experience and constitutes a proper issue.

lwouis commented 1 year ago

@mikluko please share this feedback with Apple. Apple pushed this change to all their customers. AltTab can't change this new policy.

starcraft66 commented 1 year ago

I filed FB13209646 with more or less the content of my previous reply.

iammattlewis commented 1 year ago

Everyone keeps calling the UI an "issue". As far as i understand, it's exactly what Apple wants: make people extra aware of apps capturing their screen or windows.

i think it's a feature not a bug, and people who don't like to be notified so boldly may want to turn to Apple. Apple designed this warning UI. It seems to me it's behaving exactly as they intended. AltTab can't control what Apple does here

Yes, this is the "issue". This is not an AltTab bug, but rather a Sonoma feature. I have contacted Apple, but they haven't provided any update/resolution as of yet. It's not a bad thing to have this feature, but not allowing the user to turn it off/turn it off for certain apps is not very user friendly.

iammattlewis commented 12 months ago

Conversation with Apple Support. Also had a phone conversation with support team member. Gist of the call was "it's a privacy feature, but it shouldn't be showing up that much." I explained I was using a third party window switcher, and he said there is currently not a way to stop it, and there are no plans to implement the ability to turn off the menu bar notification.

Unfortunately, this will discontinue my use of AltTab for the time being, and that is entirely the fault of Apple. I wish they would let me use my computer how I want instead of implementing features that you have zero control over, but alas...that is the Apple way, it seems.

image
arthurflor23 commented 12 months ago

I would suggest an improvement on AltTab without thumbnails by default, because macos alt+tab appearance is good, but it doesn't allow as many customizations as AltTab. So it could be a possibility to take advantage of.

ravibrock commented 12 months ago

You will also notice a new menu bar item in macOS Sonoma, informing you that Bartender is capturing your screen whenever it gets an image of your menu bar items, again this is new in macOS Sonoma, and currently unavoidable, because of the same API issue. I am working on Bartender 5 right now that will have the ability to avoid this happening.

(From Bartender's website)

It seems there could be a workaround? I'm sorry that I don't know the details, but it might work for AltTab as well.