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

Notifications appear in Zoom screen sharing on Big Sur 11.1 #90

Open
karlhorky opened this issue Jan 30, 2021 · 12 comments
Open

Notifications appear in Zoom screen sharing on Big Sur 11.1 #90

karlhorky opened this issue Jan 30, 2021 · 12 comments

Comments

@karlhorky
Copy link

On Big Sur - macOS 11.1 (20C69), notifications appear in Zoom 😵 while screen sharing (with Muzzle 1.7 and Zoom Version: 5.4.9 (59931.0110)).

I have disabled the built-in Zoom option "Silence system notifications when sharing desktop":

Screen Shot 2021-01-30 at 15 16 28

And also allowed Muzzle under Privacy -> Accessibility:

Screen Shot 2021-01-30 at 15 24 12

@karlhorky
Copy link
Author

karlhorky commented Jan 30, 2021

So, one more detail that is probably relevant here:

I have the setting checked in macOS System Preferences "Automatically hide and show the menu bar":

If I hover over the menu bar while starting the Zoom screen sharing, then Muzzle activates Do Not Disturb as it should 🤯

So maybe this is a bug with the menu bar not being visible...

@karlhorky
Copy link
Author

Workaround: Until Muzzle works with Big Sur 11.1 (and maybe even after, if I can find an npm module that reliably checks for the "screen sharing" status), here's a working npm package that will run in the background and disable and enable Do Not Disturb when a Zoom call starts:

https://github.com/karlhorky/do-not-disturb-during-zoom-macos

cc @dan2k3k4

@bdkjones
Copy link
Owner

@karlhorky Ahhhh, that's the issue. Your menubar must be visible for Muzzle to work. I'll update the app's documentation to say so and I'll see if I can add an in-app warning when the menubar isn't visible.

The reason for this is that there is no approved Apple API to toggle DND on and off. This leaves only one approach: the accessibility API that inspects UI elements to provide services such as Voiceover and screen readers, etc. For that API to work, the UI element in question must be on screen—in this case, the menu bar.

@karlhorky
Copy link
Author

Hmm, I think there are a few ways of achieving it without the menu bar visible (eg. the one that is working in my repo above).

This thread outlines some approaches. The one I use is at the bottom:

sindresorhus/do-not-disturb#9 (comment)

@karlhorky
Copy link
Author

Ah and by the way, would you be open to sharing the low-level hook in macOS you use to see whether screen sharing is being used? Wasn't able to find a solution for that in a quick search...

@bdkjones
Copy link
Owner

bdkjones commented Jan 31, 2021 via email

@bdkjones
Copy link
Owner

The kernel hook I use wouldn't work in npm land. There is no way to interface with it from Javascript. Finding a way to interface with hidden, private kernel APIs from a Javascript engine would win you the million dollar bug bounty!

@bdkjones
Copy link
Owner

bdkjones commented Jan 31, 2021

I should add: you're not at all wrong; there are many different ways to toggle DND on and off, given that there is no official API to do so. I have used a variety of approaches over the last five years as the OS changed.

On balance, accepting that Muzzle does not work with the menubar hidden is a better alternative than modifying part of a private plist and then nuking system processes to clear caches. Will that approach produce side effects? Maybe, maybe not. Will it be safe in future updates to the OS, when that system process changes and is now more critical? Who knows?

Muzzle is a good Mac citizen. It does use private APIs, but it works in a safe way that I know will never break anyone's machine or corrupt state or suddenly implode with the next point-release of macOS. Muzzle has millions of installs and I take that footprint seriously. If I fuck up, there's gonna be a lot of angry people with pitchforks.

I want folks to know they can trust my work and part of that means not doing things that are (or could become) risky. That calculus is different when you have a script that you're running on YOUR Mac, and not millions of other folks' machines. For tools that I don't ship widely, I'll bash macOS in the face all day long. I just can't do that with Muzzle.

@karlhorky
Copy link
Author

Seems reasonable, I understand what you're saying. Tradeoffs are hard, and your approach of assuming for stable methods sounds nicer compared to the brute force options.

@karlhorky
Copy link
Author

The kernel hook I use wouldn't work in npm land. There is no way to interface with it from Javascript. Finding a way to interface with hidden, private kernel APIs from a Javascript engine would win you the million dollar bug bounty!

I was actually thinking of writing some code in another language for this (obj C or Swift) and then providing bindings to that in JS so many more could use it.

Would you be willing to share the private API that Muzzle uses?

@aaronjensen
Copy link

It's not clear what the status is on this--there have been a few releases that claim to fix it, but on macOS 11.4 with Muzzle 1.9 I still see the notifications appear and disappear any time it activates, regardless of whether or not it's zoom. Is there anything I can do to help?

@bdkjones
Copy link
Owner

Someone reported that it's not actually Muzzle's fault. It's a bug in macOS. Option-click the clock icon (to toggle DND) and you'll see that the notifications drawer hides/shows. I've reported the issue to Apple, but Apple is busy finding new ways to make my Airpods Max connect to every device except the one I want it to connect to, so I wouldn't hold my breath.

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

No branches or pull requests

3 participants