Skip to content

fix: notifications not displaying for menu bar app#20

Open
masonc15 wants to merge 1 commit intoangristan:mainfrom
masonc15:fix/notifications-not-displaying
Open

fix: notifications not displaying for menu bar app#20
masonc15 wants to merge 1 commit intoangristan:mainfrom
masonc15:fix/notifications-not-displaying

Conversation

@masonc15
Copy link

@masonc15 masonc15 commented Jan 18, 2026

I noticed notifications weren't triggering on my Mac despite having them enabled in the menu. After investigating, I found the root cause: macOS silences notifications for foreground apps by default, and menu bar apps like MacThrottle (configured with LSUIElement, meaning no Dock icon) are treated as foreground.

The fix implements UNUserNotificationCenterDelegate and adds the willPresent delegate method to explicitly request banner presentation. This affects all users on all macOS versions since 10.14 Mojave.

Changes:

  • Add UNUserNotificationCenterDelegate conformance to ThermalMonitor
  • Set notification center delegate on init
  • Implement willPresent to call completion handler with .banner and .sound

I've found this utility invaluable and have been using it constantly since reading your blog post a few weeks ago. I'm slightly new to OSS development, so let me know if I should change or improve anything. Thanks!

@masonc15 masonc15 marked this pull request as ready for review January 18, 2026 18:58
@angristan
Copy link
Owner

Interesting, this sounds legit but I wonder why notifications work for me?

@masonc15
Copy link
Author

Yeah, I figured as much - definitely weird. I'm running MacThrottle on an M2 Macbook Air on Tahoe 26.2. Not sure if other people have experienced the same notification bug, but this patch got it working for me at least.

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 this pull request may close these issues.

2 participants