-
Notifications
You must be signed in to change notification settings - Fork 2
files core monitor touchbarprivatepresenter swift 403f0e46
ventaphobia edited this page Apr 23, 2026
·
1 revision
- Area: Touch Bar and Pock widget runtime.
- This page records the file's current repository role, source metadata, and recent commit history.
- Review nearby tests and commit pages before changing this file.
| Field | Value |
|---|---|
| Source path | Core-Monitor/TouchBarPrivatePresenter.swift |
| Wiki area | Touch Bar and Pock widget runtime |
| Exists in current checkout | True |
| Size | 1043 bytes |
| Binary | False |
| Line count | 40 |
| Extension | .swift |
AppKit
| Kind | Name | Line |
|---|---|---|
| class | TouchBarPrivatePresenter |
4 |
| func | attach |
9 |
| func | present |
13 |
| func | dismiss |
27 |
| func | dismissToSystemTouchBar |
34 |
| Commit | Date | Subject |
|---|---|---|
011232b |
2026-04-11 | Update website install video |
31da3f2 |
2026-04-06 | ui update |
0fa238c |
2026-04-02 | commits. |
3651f98 |
2026-03-29 | Remove CoreVisor and virtualization support |
34b59ac |
2026-03-29 | Update app UI and website branding |
b436125 |
2026-03-28 | Improve Touch Bar behavior, CoreVisor UI, and docs |
3252194 |
2026-03-27 | Clean repo and keep only active Core-Monitor project |
61a73aa |
2026-03-15 | Commit ig |
81e0938 |
2026-03-13 | Add auto fan aggressiveness slider and fix QEMU boot/display defaults |
- Prefer focused changes that respect the ownership described above.
- If this file touches helper trust, SMC writes, startup, or permissions, update the relevant support docs and tests.
- If this file is generated or an asset manifest, verify the producing workflow instead of hand-editing generated payloads.
import AppKit
@available(macOS 13.0, *)
@MainActor
final class TouchBarPrivatePresenter: NSResponder {
private var activeTouchBar: NSTouchBar?
private var previousMode: String?
private var isVisible = false
func attach(to window: NSWindow) {
window.touchBar = nil
}
func present(touchBar: NSTouchBar) {
if let activeTouchBar, isVisible {
CMDismissTouchBarFromTop(activeTouchBar)
isVisible = false
}
previousMode = previousMode ?? CMCurrentTouchBarPresentationMode()
activeTouchBar = touchBar
isVisible = true
CMPresentTouchBarOnTop(touchBar, 1)
CMSetTouchBarPresentationMode("app")
}
func dismiss() {
guard isVisible, let activeTouchBar else { return }
CMDismissTouchBarFromTop(activeTouchBar)
self.activeTouchBar = nil
isVisible = false
}
func dismissToSystemTouchBar() {
dismiss()
CMSetTouchBarPresentationMode(previousMode ?? "appWithControlStrip")
}
}
- Home
- Start Here
- Product Overview
- Runtime Architecture
- Monitoring Pipeline
- Fan Control
- Privileged Helper
- Touch Bar
- Release Automation
- Security Model
- File Index (279)
- Every Commit (401)
- Chronological Change Log
- Removed Parts
- All Deleted Paths
- Branches And Tags
- Wiki Manifest
- Start Here
- Product Overview
- Source Map
- Runtime Architecture
- App Startup And Lifecycle
- Dashboard Architecture
- Menu Bar Architecture
- Monitoring Pipeline
- Snapshot Trends And Freshness
- CPU GPU Memory Disk Network
- Battery Power And Thermals
- SMC And Apple Silicon
- Fan Control
- Custom Fan Curves
- Privileged Helper
- XPC Trust Boundary
- Helper Diagnostics
- Touch Bar Architecture
- Touch Bar Customization
- Weather And Location
- Privacy And Permissions
- Onboarding And Help
- Legacy Alerts
- Kernel Panic Weird Mode