lwouis / alt-tab-macos

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

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

Closed 5cj closed 1 year 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

fungiboletus commented 1 year ago

As I was sharing my screen in a meeting, I noticed that the new screen capturing notification wasn't bothering me near as much as when it appears and disappear every time I use AltTab.

So behold the following terrible hack to make the purple icon always visible:

function triggerScreenCaptureNotification()
  local allWindows = hs.window.allWindows()

  local smallestWindow = nil
  local smallestSize = 100000000

  for _, window in pairs(allWindows) do
    local currentSizeObj = window:size()
    local currentSize = currentSizeObj.w * currentSizeObj.h
    if currentSize < smallestSize then
      smallestSize = currentSize
      smallestWindow = window
    end
  end

  local snapshot = smallestWindow:snapshot()
end

triggerScreenCaptureNotification()
timerScreenCapture = hs.timer.doEvery(9, triggerScreenCaptureNotification)

Put that in your HammerSpoon configuration and allow it to screen capture your screen.

I am not responsible if someone captures your screen and you don't notice. Use at your own risk. Code is released under the WTFPL.

SarcevicAntonio commented 1 year ago

Can we make the "Hide window thumbnails" option show the App icons instead, nice and big, like for apps with no open windows?

z4ffe commented 1 year ago

@SarcevicAntonio Good idea!

Lakshmann commented 1 year ago

That sounds fair: leave the thumbnail previews behind but still have the window-based switching with a look closer to the native cmd-tab (larger icons, as stated above).

aubreypwd commented 1 year ago

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.

I can confirm that with this off:

image

I don't see the purple button anymore.

CleanShot 2023-10-03 at 08 20 13@2x

iammattlewis commented 1 year ago

Using it without the window thumbnails is fine, but defeats a lot of the purpose (at least for me).

conker-rsc commented 1 year ago

Can we make the "Hide window thumbnails" option show the App icons instead, nice and big, like for apps with no open windows?

+1 to that idea -- with this option enabled, one could also set "window app icon size" to 0px to get even more room for the window title above the icon, which would be nice as well.

MaxCollinYuan commented 1 year ago

Bartender 5 has made it possible not to display the purple button "XXX is sharing your screen" on the menu bar. Why can't AltTab do it?

lwouis commented 1 year ago

@MaxCollinYuan the 2 apps do different things. I guess they found a way to not screenshot the menubar. Maybe Sonoma introduced new APIs to inspect the menubar?

AltTab has to screenshot the windows to show thumbnails to the user. We also need Screen Recording permission to get the window titles. See #1082 to learn more.

The way you ask your question is rude. Some other people in this thread are rude as well. AltTab is me spending probably 300h at this point, on my weekends and evenings, to create an app and share it with other people. I don't take donations and the only thing I get from this project is the satisfaction of helping other people.

Imagine going to a dog shelter, and complaining to the guy who runs it about some inconvenience you experienced in the shelter. How entitled are you? If you don't like something about this free app, the decent behavior is to politely ask if it can be improved. There is also the option to not use the free app and be silent.

It's not often i have to deal with unpleasant people, thankfully. This Sonoma issue has brought a crowd most unpleasant for some reason.

If you want a change, advocate to Apple. Or share a pull-request with your own work to improve things. Or ask people here politely if they could help you with a fix. Or uninstall the app and have the dignity to not complain about something you got for free in the first place.

Thank you

emirrou commented 1 year ago

Bartender 5 has made it possible not to display the purple button "XXX is sharing your screen" on the menu bar. Why can't AltTab do it?

As of right now bartender does trigger the purple icon, but only when you use the "Bartender Bar", which shows your menu bar items below the actual menu bar. iirc in bartender5 it is turned off by default and in the settings it also warns you about this behaviour.

ayroblu commented 1 year ago

For what it's worth, I submitted feedback to Apple via their feedback assistant, I'm not really sure if it's the right place or if they even look at it, but just sharing here in case anyone wants to use it as a template for feedback too, as I'm sure more reports would lead to more traction on their side.

Basic Information

Please provide a descriptive title for your feedback:

Disable \ is sharing your screen for certain apps due to security risk

Which area are you seeing an issue with?

Menu Bar

What type of issue are you reporting?

Incorrect/Unexpected Behavior

Details

What does the Menu Bar issue you are seeing involve?

Something else not on this list

What is the active application?

AltTab

Which display is the menu bar on?

My primary display

Description

Please describe the issue and what steps we can take to reproduce it:

When using known accessibility tools like AltTab, macOS shows a "AltTab is sharing your screen". (details here: https://alt-tab-macos.netlify.app/) This is a nice new feature generally, but it's only half implemented. It's currently implemented in a somewhat useless way cause there's no way to exclude known apps. This means that users see it continuously, and will therefore ignore it. This poses a security risk if users learn to ignore it and a malicious app starts doing this in the background.

sapoepsilon commented 1 year 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.

For what it's worth, Bartender is a $16 app, while AltTab is a free app. It's probable that a workaround could be implemented on AltTab as well, but that might take a considerable amount of time. Developers contribute here whenever they have free time away from their primary jobs or school. They contribute because they enjoy development, and pursue it as a hobby.

For everyone who is condescending towards the main developer of this project, lwouis, recall what Korolev once stated:

"If you do not agree — criticize; if you criticize — offer a solution/alternative; if you offer a solution — work on implementing it."

anglee0323 commented 1 year ago

@MaxCollinYuan the 2 apps do different things. I guess they found a way to not screenshot the menubar. Maybe Sonoma introduced new APIs to inspect the menubar?这两个应用程序做不同的事情。我猜他们找到了一种不截图菜单栏的方法。也许索诺玛引入了新的 API 来检查菜单栏?

AltTab has to screenshot the windows to show thumbnails to the user. We also need Screen Recording permission to get the window titles. See #1082 to learn more.AltTab 必须对窗口进行屏幕截图才能向用户显示缩略图。我们还需要屏幕录制权限才能获取窗口标题。请参阅#1082 了解更多信息。

The way you ask your question is rude. Some other people in this thread are rude as well. AltTab is me spending probably 300h at this point, on my weekends and evenings, to create an app and share it with other people. I don't take donations and the only thing I get from this project is the satisfaction of helping other people.你问问题的方式很粗鲁。这个线程中的其他一些人也很粗鲁。 AltTab 是我在周末和晚上花费了大约 300 个小时来创建一个应用程序并与其他人分享。我不接受捐款,我从这个项目中得到的唯一的东西就是帮助别人的满足感。

Imagine going to a dog shelter, and complaining to the guy who runs it about some inconvenience you experienced in the shelter. How entitled are you? If you don't like something about this free app, the decent behavior is to politely ask if it can be improved. There is also the option to not use the free app and be silent.想象一下,你去了一个狗收容所,并向收容所的经营者抱怨你在收容所遇到的一些不便。你有什么权利?如果您不喜欢这个免费应用程序的某些内容,礼貌的行为是礼貌地询问是否可以改进。还可以选择不使用免费应用程序并保持沉默。

It's not often i have to deal with unpleasant people, thankfully. This Sonoma issue has brought a crowd most unpleasant for some reason.谢天谢地,我并不经常与不愉快的人打交道。出于某种原因,索诺玛的这个问题给人群带来了最不愉快的感觉。

If you want a change, advocate to Apple. Or share a pull-request with your own work to improve things. Or ask people here politely if they could help you with a fix. Or uninstall the app and have the dignity to not complain about something you got for free in the first place.如果你想改变,请向苹果公司求助。或者与您自己的工作共享拉取请求以改进内容。或者礼貌地询问这里的人是否可以帮助您解决问题。或者卸载该应用程序,并有尊严地不抱怨你一开始就免费获得的东西。

Thank you 谢谢

I understand how you feel. Some people do tend to talk too much. I hope you don't take it personally. Lately, I have been looking into Apple's new API, and I have formed some opinions on how to solve this problem. I hope those who have a desire to contribute can work together to improve this poor user experience. Wishing you a happy life!

phil-chp commented 1 year ago

Can we make the "Hide window thumbnails" option show the App icons instead, nice and big, like for apps with no open windows?

I've always been used to the way Windows showed the preview of the app, I found that to be a very useful feature, but It's very annoying to have that purple icon at the top, and as @ayroblu puts it, is it a security risk.

I could get used to the native ⌘+Tab look, though, I would still use AltTab, as the native one is poorly thought out, and gets messy very quickly. Doing this on AltTab is actually almost possible, just by playing with the settings. The only piece missing (I guess) is that 0px titles should take 0 width (or there should be an option to disable titles):

Screenshot 2023-10-02 at 4 00 17 PM

My settings:

Screenshot 2023-10-02 at 4 00 13 PM
lwouis commented 1 year ago

@Philippe-cheype You can get closer to the native switcher look by tweaking the sliders more. Window min width in row in your case especially, I think. Some people have achieved essentially the same look at the native switcher in the past.

There is an ongoing effort here to make the switch between "Window alt-tab style" and "native app switcher style" very easy. There is more to it actually. Lots to read here: #351. I recorded a video to explain the vision here if you prefer videos. There is this open PR https://github.com/lwouis/alt-tab-macos/pull/2697 to implement it.

phil-chp commented 1 year ago

@lwouis OH! that's amazing. Great work from all the contributors, AltTab really does it all.

(For anyone interested: the settings I showed above + Window min width in row: 1% and play with the Window app icon size to your liking)

Qhilm commented 1 year ago

It's probable that a workaround could be implemented on AltTab as well, but that might take a considerable amount of time.

I don't think so. From apple's point of view, it's a security feature. If there was a workaround allowing not to display the dreaded icon in the menu bar while actually capturing element of the GUI of macOS (windows, menu bar, etc.), that would be considered a vulnerability.

For this reason I think Apple developed this "feature" in a way that it is not possible to work your way around it – unless you actually hack macOS sonoma, but I think that would put altTab on a whole different plane, a much riskier one for the developer actually (and also significantly more time consuming).

Hence I think the recommendation to voice your discontent with Apple is the correct feedback here, as it's the only realistic way forward: Apple must implement in macOS a way to whitelist trusted (and code signed) apps.

I'll be honest though and say my hopes are very low on this front...

[edit] @lwouis : you make an amazing app, it's the best window switcher out there in my opinion and it's FREE. Just amazing. Don't let rude people get a rise out of you, it's not worth it.

Damecek commented 1 year ago

If the Screen Capture feature would not be mandatory we will loose the thumbnails + window titles. The thumbnails is not a huge deal as you can turn on the preview of selected window. Personally I would give up on the window titles if it would mean we can get rid of the purple icon in bar.

lwouis commented 1 year ago

The thumbnails is not a huge deal as you can turn on the preview of selected window.

The preview is also a screenshot of the window. It would trigger the Sonoma warning like thumbnails do.

Damecek commented 1 year ago

The preview is also a screenshot of the window. It would trigger the Sonoma warning like thumbnails do.

:/ i thought that it just brings the window to foreground like focus. that is unfortunate.

dslittle22 commented 1 year ago

I'm running Bartender 5, and it seems like the way they get around the screen sharing alert is by completely reworking the system for conditionally showing/hiding menu bar items. Previously you were able to say "show this menu bar item if it matches this image", and in Bartender 5 that screenshot-based system is completely gone; now you get a set of possible triggers, i.e. "if X app is open", "if wifi is disconnected", "if battery is charging", etc. It's a solid workaround, but is certainly less flexible than the system before.

All of this is to say: Bartender 5's fix for this is nontrivial, and it arguably makes it a less powerful app. There doesn't seem to be any 'quick fix' to prevent this alert while still showing previews (at least on AltTab's end- maybe there is on Apple's). AltTab is an awesome, powerful, free app, that was already customizable enough to prevent the alert by hiding previews.

Qhilm commented 1 year ago

From the bartender website:

Whenever Bartender gets an image of a menu bar item macOS will show the purple screen capture menu bar item

This menu bar item cannot be hidden, or disabled by Bartender and is put there by macOS

Also, I own bartender 5 and I can confirm the above is accurate for bartender 5 (latest version).

Bartender "simply" added a switch to disable the feature triggering the security warning, they didn't really worked around it in my view. Bartender is lucky this feature is not core to its functionality.

Unfortunately, a window switcher is a different type of app and the snapshot/preview of the windows is a core feature, removing it makes the app unusable (at least for me): I would be blindly switching around between 10 windows all represented by the same Firefox icon – if I have 10 Firefox windows open, for example. This is not usable.

My view is, unless there's a change in macOS, it is not possible for AltTab to prevent this icon from showing while maintaining a usable app. In the mean time, there are only two options: stop using a window switcher on macOS (not just AltTab but any window switcher) or get used to the purple icon in the menu bar...

Neoconair commented 1 year ago

Not a solution but using just the app icons + window titles has actually proved a better way to use the app for me.

Turns out I can parse the titles faster than the window previews!

Qhilm commented 1 year ago

Nice, I just realised, I can make AltTab behave like Witch (which I gave up on because it was too slow – haven't used it in a long while though).

I will give it a try but I'm worried about Firefox (to use my prior example): window title is the active tab. I use a window for projects, and they tend to have tabs to same websites open. Let's try it.

Thanks!

jhonalves commented 1 year ago

It has been a week since i updated to macOS Sonoma and now i'm used to the icon in the menu bar. It's still a little annoying, but most of the time i don't even notice it. My experience reinforce what was said here that Apple got it wrong when they did not provide an option to create a whitelist with trusted apps and now the user will always ignore the warning, even if it's not from a trusted app.

andres-martinez-torres commented 1 year ago

It would be awesome to keep the coloured circles when we disable the window thumbnails. I personally use the feature a lot.

siikdUde commented 1 year ago

Seeing as how this probably won't be fixed anytime soon, is there at least an option to remove alt tab from displaying on the menu bar? A lot of other apps have the option to remove it and I certainly don't need to see it as it takes up space for other more useful menu bar items like google drive, dropbox, etc. Can this option be added please?

sapoepsilon commented 1 year ago

Seeing as how this probably won't be fixed anytime soon, is there at least an option to remove alt tab from displaying on the menu bar? A lot of other apps have the option to remove it and I certainly don't need to see it as it takes up space for other more useful menu bar items like google drive, dropbox, etc. Can this option be added please?

It is already there. Check in the settings window

siikdUde commented 1 year ago

Seeing as how this probably won't be fixed anytime soon, is there at least an option to remove alt tab from displaying on the menu bar? A lot of other apps have the option to remove it and I certainly don't need to see it as it takes up space for other more useful menu bar items like google drive, dropbox, etc. Can this option be added please?

It is already there. Check in the settings window

I have many times for the past few months on all categories. I must be missing something then. Would you be able to give a screenshot of where it is exactly in the settings? I would really appreciate it, thank you

sapoepsilon commented 1 year ago

Seeing as how this probably won't be fixed anytime soon, is there at least an option to remove alt tab from displaying on the menu bar? A lot of other apps have the option to remove it and I certainly don't need to see it as it takes up space for other more useful menu bar items like google drive, dropbox, etc. Can this option be added please?

It is already there. Check in the settings window

I have many times for the past few months on all categories. I must be missing something then. Would you be able to give a screenshot of where it is exactly in the settings? I would really appreciate it, thank you

image

siikdUde commented 1 year ago

Wow, I completely just overlooked that. Thanks so much!

xconverge commented 1 year ago

I still see the icon every once in awhile with window previews disabled (where it was shown everytime I alt-tabbed)

Does anyone know what feature may be causing this and if it is able to be disabled as well?

lwouis commented 1 year ago

@xconverge it may be the periodic check that the screen recording permission is given. The idea is to make a 0x0 screenshot to confirm that the permission is granted. There is no better API/way to check that.

It could also be when we read window titles.

I'm still not on Sonoma, so i haven't dug into the details of this new UI, and which exact API calls trigger it.

HackettLai commented 1 year ago
Screenshot 2023-10-06 at 09 39 27

vlcsnap-2023-10-06-09h40m12s286

I found this setting works great for me, just sharing it with all of you guys

Qhilm commented 1 year ago

coloured circles

What are these coloured circles? What do they do?

andres-martinez-torres commented 1 year ago

coloured circles

What are these coloured circles? What do they do?

Basically the red, yellow, green buttons for each window (close, minimise, full-screen). I often used those to close windows in alt-tab without having to open them.

Duc-NSH commented 1 year ago
Screenshot 2023-10-06 at 09 39 27

vlcsnap-2023-10-06-09h40m12s286

I found this setting works great for me, just sharing it with all of you guys

This setting is great for me too, now I can use alt-tab without thumbnail comfortably

lwouis commented 1 year ago

I've updated to Sonoma today, and was able to investigate this.

It seems to only show when we make the API call to take a screenshot. It doesn't seem to show the purple indicator when we:

The only thing we could do, it seems to me, is offer an AltTab experience without thumbnails, for people who can't stand the purple icon. We already do that by checking out the checkbox in Preferences > Appearance > Hide window thumbnails.

There are 2 tickets which may improve and expand upon that thumbnail-less experience:

Closing this ticket as there is no direct action we can take, and incremental improvements are tracked in the tickets above.

wookayin commented 1 year ago

It doesn't seem to show the purple indicator when we:

Get a window title Get an app icon Get window metadata (e.g. minimized, hidden, dimensions, etc)

@lwouis Thanks for the support, but I think there still are some cases where AltTab is taking screenshots even when it's not needed for thumbnails.

I use AltTab for cmd-` (shows screenshot/thumbnail) and option-tab only; so for me, cmd-tab is the macOS builtin cmd-tab. So when I do cmd-tab, AltTab is neither supposed to work, nor should try to capture window metadata, app icon, or thubmnails. But I can consistently see that whenever I open the macOS built-in window switcher with cmd-tab, or sometimes when a new app/window is open, etc., the purple icon in the menubar appears saying that "AltTab is capturing your screen". So I suspect there still remains a case where AltTab is trying to take screenshot even when it's not really needed.

If you think this is a separate bug that you'd like to track outside this thread, I'd be happy to open a new issue.

lwouis commented 1 year ago

Hi @wookayin,

AltTab monitors changes in windows, and when important changes happen, it takes a new screenshot of the window. This happens in the background, in addition to when AltTab UI is showing. For example, if you create a new window, AltTab will screenshot it, in the background. That way, when you next open AltTab, it can show extremely quickly, since it's ready with the screenshots of every window. No delay to get the screenshots ready.

Try to check the Preferences > Appearance > Hide window thumbnails. At this point, I don't see you'll ever see the purple icon again. If you do, then yes, that would indicate something else I'm not thinking of is going on.

xconverge commented 1 year ago

I definitely saw the same behavior with the disable thumbnail button checked as I mentioned up above so I think there is something else going on

lwouis commented 1 year ago

@xconverge could you please open a ticket with steps to reproduce and a video showcasing the issue?

Thank you

ElhemEnohpi commented 1 year ago

@Qhilm -

I will give it a try but I'm worried about Firefox (to use my prior example): window title is the active tab. I use a window for projects, and they tend to have tabs to same websites open. Let's try it.

I also work that way in Firefox. I use the Window Titler addon to give a custom title to each window, i.e. the name of the project, and it's prepended to whatever the active tab title is. I turned off thumbnails because of the purple icon issue, and re-arranged the appearance to a vertical list of the titles, with a single column. I kind of miss the thumbnails, but I can still use the important functions of AltTab about as well as before. There's even the advantage that I can see more of the titles now.

scottkuhl commented 1 year ago

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

This is the best answer given. Apple has introduced a security feature, so users see when something is trying to record their screen. No idea if that will ever make a single difference, but I believe this is the reason. There absolutely should be a way for users to mark an app as safe.

The option to turn off the thumbnails is a nice workaround but disables a great feature of AltTab. There is nothing more this project can do, so pressure should be put on Apple.

@fifafu is there any link to that feedback to Apple to track status or pile on votes?

burdo3417 commented 1 year ago

Updated to Sonoma 14.1 today and the Warning icon in the menu bar seems to be gone. All good even whith thumbnails on.

conker-rsc commented 1 year ago

Updated to Sonoma 14.1 today and the Warning icon in the menu bar seems to be gone. All good even whith thumbnails on.

I am still seeing it occasionally - just far less often than 14.0

Duc-NSH commented 1 year ago

Updated to Sonoma 14.1 today and the Warning icon in the menu bar seems to be gone. All good even whith thumbnails on.

I am still seeing it occasionally - just far less often than 14.0

same here, it does not always show as in 14.0 but it still shows from time to time

DownrightNifty commented 1 year ago

Just recently upgraded to Sonoma. The icon is distracting and it's frustrating that Apple provides no option to disable it. Regardless, I appreciate the effort that went into compensating for Apple's bad decisions.

I was recently thinking about this, though: would it be less distracting if the icon was permanently there, rather than popping up intermittently? Maybe there could be an option to make the app continually make bogus API requests so the icon never goes away?

Edit: Scrolling back through the comments, it seems someone has implemented a hacky version of this already hacky approach using an external app: https://github.com/lwouis/alt-tab-macos/issues/2606#issuecomment-1739342742

burdo3417 commented 1 year ago

Updated to Sonoma 14.1 today and the Warning icon in the menu bar seems to be gone. All good even whith thumbnails on.

I am still seeing it occasionally - just far less often than 14.0

same here, it does not always show as in 14.0 but it still shows from time to time

I haven't seen it again. Not once. Weird.

Qhilm commented 1 year ago

I was recently thinking about this, though: would it be less distracting if the icon was permanently there, rather than popping up intermittently? Maybe there could be an option to make the app continually make bogus API requests so the icon never goes away?

I think it defeats the whole purpose of this macOS security feature. If an a malicious app starts recording your screen, you will never notice, because the icon is anyway displayed around the clock on your device.

The purpose of this (admittedly) annoying icon is to alert the user that some app is recording a portion or the whole screen.

The right way to fix this is for apple to implement whitelisting. But unless the product of a major player (adobe, microsoft, google, etc.) is impacted, I don't see Apple implementing it.