[PR #1931] Add native-style Liquid Glass OSD HUD for macOS 26 and 27 #1340

Open
opened 2026-10-26 22:01:33 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MonitorControl/MonitorControl/pull/1931
Author: @tusharxclaude
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: feat/macos27-liquid-glass-osd


📝 Commits (9)

  • a4e60d5 Add native-style Liquid Glass OSD HUD for macOS 26 and 27
  • fd25cbb Respect Reduce Motion and add VoiceOver levelIndicator accessibility to OSD HUD
  • 437818f Support adaptive Light and Dark mode appearance in Liquid Glass OSD HUD
  • 81523ba Use adaptive SystemBanner glass variant (_variant = 9, 63pt height)
  • fc37fa2 Adapt Liquid Glass OSD HUD foreground and appearance to backdrop luminance
  • c2c3be8 Update OSD HUD to new capsule design with segmented bar and callout bubble
  • b3111fb Keep white foreground on mid-luminance colored backdrops
  • 1fda859 Apply HUD corner radius after glass variant and raise luma thresholds
  • c1fb098 Inset luma backdrop layer so its aliased clip edge doesn't show at the HUD outline

📊 Changes

5 files changed (+599 additions, -72 deletions)

View changed files

📝 MonitorControl/Info.plist (+1 -1)
📝 MonitorControl/Model/AppleDisplay.swift (+37 -0)
📝 MonitorControl/Model/Display.swift (+12 -1)
📝 MonitorControl/Support/OSDUtils.swift (+545 -70)
📝 MonitorControl/Support/SliderHandler.swift (+4 -0)

📄 Description

Summary

In macOS 26/27 (Tahoe+), the private OSDUIHelper XPC service no longer displays the legacy chiclet HUD when OSDManager.sharedManager().showImage(...) is called. As a result, adjusting brightness, contrast, or volume on external displays via MonitorControl produces no on-screen feedback.

This PR introduces a native macOS 26+ Liquid Glass On-Screen Display HUD (MacOS27OSDHudController, OSDHudPanel, MacOS27OSDHudView) in OSDUtils.swift while preserving the legacy OSDManager path for macOS 15 and earlier.

What's Changed

  • Native NSGlassEffectView Banner Pill (292 × 63 pt, cornerRadius = 19.5):
    • Uses the adaptive SystemBanner glass variant (_variant = 9 / notificationCenter material at 63 pt height) so the backdrop preserves wallpaper color saturation and renders the native luminous specular rim.
    • Displays the friendly display name (Display.getFriendlyName()), a pill badge (56%, 56% • 280 nits when nits calibration is available, or Locked), min/max SF Symbols (sun.min.fill/sun.max.fill, speaker.fill/speaker.wave.3.fill, circle.lefthalf.filled/circle.righthalf.filled), a continuous progress bar, and 16 chiclet tick dots.
  • Active Glass Rim on Non-Activating NSPanel:
    • Overrides hasKeyAppearance, _hasActiveAppearance, and _hasActiveControls on the borderless .nonactivatingPanel with hasShadow = false so NSGlassEffectView renders its luminous specular glass border without stealing focus from the active app or drawing a dark rectangular window shadow.
  • Real-Time Backdrop Luminance Adaptation, Reduce Motion, and VoiceOver Accessibility:
    • Uses a WindowServer-aware CABackdropLayer (tracksLuma = true) with hysteresis (0.45 / 0.53) to sample the real-time luminance behind the HUD pill and automatically flip the glass appearance and foreground colors (.darkAqua vs. .aqua), preventing dark-on-dark or white-on-white text regardless of the system Light/Dark mode setting.
    • Respects NSWorkspace.shared.accessibilityDisplayShouldReduceMotion to skip fade animations when Reduce Motion is enabled.
    • Exposes .levelIndicator accessibility role, display title label, and percentage/nits value on the track bar for VoiceOver.
  • Multi-Display & Hardware/Software Control Routing:
    • Adds DisplayManager.resolveEffectiveDisplayID(_:) and routes OSD calls through the effective display ID so virtual/software-dimmed displays resolve to their physical screen.

Screenshots

Dark Green Backdrop (luma = 0.27 → .darkAqua) Light Green Backdrop (luma = 0.78 → .aqua)
Dark Green Wallpaper Light Green Wallpaper
Dark Backdrop in Light Mode (luma = 0.12 → .darkAqua) Light Backdrop in Dark Mode (luma = 0.95 → .aqua)
Dark Desktop Light Desktop

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MonitorControl/MonitorControl/pull/1931 **Author:** [@tusharxclaude](https://github.com/tusharxclaude) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/macos27-liquid-glass-osd` --- ### 📝 Commits (9) - [`a4e60d5`](https://github.com/MonitorControl/MonitorControl/commit/a4e60d51d58c27eaec47a650ac22065c6f8f1afa) Add native-style Liquid Glass OSD HUD for macOS 26 and 27 - [`fd25cbb`](https://github.com/MonitorControl/MonitorControl/commit/fd25cbbd43ac5ad2866f3ae752f055d92e75ec54) Respect Reduce Motion and add VoiceOver levelIndicator accessibility to OSD HUD - [`437818f`](https://github.com/MonitorControl/MonitorControl/commit/437818f49cc83db97e41c5eb07e21d35d6c9331e) Support adaptive Light and Dark mode appearance in Liquid Glass OSD HUD - [`81523ba`](https://github.com/MonitorControl/MonitorControl/commit/81523ba8d0acd7da4578026dec8c10fc5fa9174c) Use adaptive SystemBanner glass variant (_variant = 9, 63pt height) - [`fc37fa2`](https://github.com/MonitorControl/MonitorControl/commit/fc37fa286c643d6ae9e9eaf7b16680854cbe2b64) Adapt Liquid Glass OSD HUD foreground and appearance to backdrop luminance - [`c2c3be8`](https://github.com/MonitorControl/MonitorControl/commit/c2c3be863a6587c3f575598322900a3ef9e8e09e) Update OSD HUD to new capsule design with segmented bar and callout bubble - [`b3111fb`](https://github.com/MonitorControl/MonitorControl/commit/b3111fb75eaf0746b242d7a1bac2d0f3e5faed2b) Keep white foreground on mid-luminance colored backdrops - [`1fda859`](https://github.com/MonitorControl/MonitorControl/commit/1fda8596b185361dafa1a69ad68cb77b4d068f5d) Apply HUD corner radius after glass variant and raise luma thresholds - [`c1fb098`](https://github.com/MonitorControl/MonitorControl/commit/c1fb098122d485ba77115c034a25601864f6bac5) Inset luma backdrop layer so its aliased clip edge doesn't show at the HUD outline ### 📊 Changes **5 files changed** (+599 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `MonitorControl/Info.plist` (+1 -1) 📝 `MonitorControl/Model/AppleDisplay.swift` (+37 -0) 📝 `MonitorControl/Model/Display.swift` (+12 -1) 📝 `MonitorControl/Support/OSDUtils.swift` (+545 -70) 📝 `MonitorControl/Support/SliderHandler.swift` (+4 -0) </details> ### 📄 Description ### Summary In macOS 26/27 (Tahoe+), the private `OSDUIHelper` XPC service no longer displays the legacy chiclet HUD when `OSDManager.sharedManager().showImage(...)` is called. As a result, adjusting brightness, contrast, or volume on external displays via MonitorControl produces no on-screen feedback. This PR introduces a native macOS 26+ Liquid Glass On-Screen Display HUD (`MacOS27OSDHudController`, `OSDHudPanel`, `MacOS27OSDHudView`) in `OSDUtils.swift` while preserving the legacy `OSDManager` path for macOS 15 and earlier. ### What's Changed - **Native `NSGlassEffectView` Banner Pill (`292 × 63 pt`, `cornerRadius = 19.5`)**: - Uses the adaptive SystemBanner glass variant (`_variant = 9` / `notificationCenter` material at `63 pt` height) so the backdrop preserves wallpaper color saturation and renders the native luminous specular rim. - Displays the friendly display name (`Display.getFriendlyName()`), a pill badge (`56%`, `56% • 280 nits` when nits calibration is available, or `Locked`), min/max SF Symbols (`sun.min.fill`/`sun.max.fill`, `speaker.fill`/`speaker.wave.3.fill`, `circle.lefthalf.filled`/`circle.righthalf.filled`), a continuous progress bar, and 16 chiclet tick dots. - **Active Glass Rim on Non-Activating `NSPanel`**: - Overrides `hasKeyAppearance`, `_hasActiveAppearance`, and `_hasActiveControls` on the borderless `.nonactivatingPanel` with `hasShadow = false` so `NSGlassEffectView` renders its luminous specular glass border without stealing focus from the active app or drawing a dark rectangular window shadow. - **Real-Time Backdrop Luminance Adaptation, Reduce Motion, and VoiceOver Accessibility**: - Uses a WindowServer-aware `CABackdropLayer` (`tracksLuma = true`) with hysteresis (`0.45` / `0.53`) to sample the real-time luminance behind the HUD pill and automatically flip the glass appearance and foreground colors (`.darkAqua` vs. `.aqua`), preventing dark-on-dark or white-on-white text regardless of the system Light/Dark mode setting. - Respects `NSWorkspace.shared.accessibilityDisplayShouldReduceMotion` to skip fade animations when Reduce Motion is enabled. - Exposes `.levelIndicator` accessibility role, display title label, and percentage/nits value on the track bar for VoiceOver. - **Multi-Display & Hardware/Software Control Routing**: - Adds `DisplayManager.resolveEffectiveDisplayID(_:)` and routes OSD calls through the effective display ID so virtual/software-dimmed displays resolve to their physical screen. ### Screenshots | Dark Green Backdrop (`luma = 0.27 → .darkAqua`) | Light Green Backdrop (`luma = 0.78 → .aqua`) | | :---: | :---: | | ![Dark Green Wallpaper](https://raw.githubusercontent.com/tusharxclaude/MonitorControl/pr-assets/macos27-liquid-glass-hud-green.png?v=2) | ![Light Green Wallpaper](https://raw.githubusercontent.com/tusharxclaude/MonitorControl/pr-assets/macos27-liquid-glass-hud-light-green.png?v=2) | | Dark Backdrop in Light Mode (`luma = 0.12 → .darkAqua`) | Light Backdrop in Dark Mode (`luma = 0.95 → .aqua`) | | :---: | :---: | | ![Dark Desktop](https://raw.githubusercontent.com/tusharxclaude/MonitorControl/pr-assets/macos27-liquid-glass-hud-standalone.png?v=2) | ![Light Desktop](https://raw.githubusercontent.com/tusharxclaude/MonitorControl/pr-assets/macos27-liquid-glass-hud-light-standalone.png?v=2) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github-starred/MonitorControl#1340
No description provided.