Survey full screen (F) exits by itself when the display's HDR headroom changes
- 0 replies
- 5 views
- Translate
Description of Issue
- In Survey view, F (Survey - Full Screen) opens a full-screen window. On an HDR display, that window closes by itself within about 0.4 s of any change in a display's HDR headroom, with no key press, app switch or dialog. In normal use, it closed by itself 3 times in two minutes.
- macOS posts
NSApplicationDidChangeScreenParametersNotificationto every app whenever a screen'smaximumExtendedDynamicRangeColorComponentValuechanges (documented in NSScreen.h). The headroom changes whenever HDR content appears on or leaves a display, from Lightroom or any other app. During the 1 s ramp that follows, macOS posts about 120 of these notifications. - AgUI's
-[AgFullScreenableWindow appDidChangeScreenParameters:]handles that notification and always posts the Lua notificationAgScreen"displayChanged", whether or not a screen's size or arrangement changed. - FullScreenSurvey.lua observes "displayChanged" with the same handler it uses for Escape,
AgApplication"appWillResign" andAgDialogs"willShowDialog": it fades the window out and closes it. - Detail - Full Screen (FullScreenLoupe.lua) gets the same "displayChanged" but doesn't close: its handler logs "screen resolution changed", runs two checks, and recreates its window ("recreating window") only when they pass.
Step-by-step Reproduction Instructions
-
On a Mac with an HDR display (tested on a MacBook Pro's built-in Liquid Retina XDR display and on an external HDR display), open Lightroom 10.0, select a few photos and press N for Survey view.
-
Save this script as
edr_pulse.swift. It needs only Xcode or its command-line tools. After a delay, it shows a small patch for 2 s, HDR or SDR, without taking the focus from the frontmost app, and prints every screen-parameters notification it receives.// Briefly shows a small HDR (EDR) patch so the display's HDR headroom changes, which makes macOS post
// NSApplicationDidChangeScreenParametersNotification to every app. Logs each such notification this process
// receives, with every screen's maximumExtendedDynamicRangeColorComponentValue.
//
// usage: swift edr_pulse.swift [delay-seconds 10] [show-seconds 2] [hdr|sdr] [x,y]
//
// The patch (80x80 points, top right of the screen containing point x,y in global top-left coordinates, as
// accessibility and CGWindowList report them; default: the screen under the mouse pointer) sits above full-screen
// windows, takes no clicks and never activates, so the frontmost app stays frontmost. "sdr" shows the same patch
// without HDR, as a control: it should change nothing. Needs only Xcode's command-line tools.
import AppKit
import Metal
import QuartzCore
let args = CommandLine.arguments
let delay = args.count > 1 ? Double(args[1]) ?? 10 : 10
let showFor = args.count > 2 ? Double(args[2]) ?? 2 : 2
let hdr = !(args.count > 3 && args[3] == "sdr")
let clock = DateFormatter()
clock.dateFormat = "HH:mm:ss.SSS"
func say(_ s: String) {
print("\(clock.string(from: Date())) \(s)")
fflush(stdout)
}
func headroom() -> String {
NSScreen.screens.enumerated().map {
"screen \($0.offset) \(String(format: "%.2f", $0.element.maximumExtendedDynamicRangeColorComponentValue))"
}.joined(separator: ", ")
}
let app = NSApplication.shared
app.setActivationPolicy(.accessory)
// One line per burst (macOS posts one notification per headroom step, ~120 a second during a ramp).
var notifications = 0
var burstCount = 0
var lastNote = Date.distantPast
func endBurst() {
if burstCount > 0 { say(" ... \(burstCount) notifications in this burst; headroom now: \(headroom())") }
burstCount = 0
}
NotificationCenter.default.addObserver(
forName: NSApplication.didChangeScreenParametersNotification, object: nil, queue: .main
) { _ in
notifications += 1
if Date().timeIntervalSince(lastNote) > 0.5 {
endBurst()
say("screen parameters changed; headroom: \(headroom())")
}
burstCount += 1
lastNote = Date()
}
var target = NSEvent.mouseLocation
if args.count > 4 {
let xy = args[4].split(separator: ",").compactMap { Double($0) }
if xy.count == 2 { target = NSPoint(x: xy[0], y: NSScreen.screens[0].frame.height - xy[1]) } // flip to Cocoa
}
let screen = NSScreen.screens.first { NSMouseInRect(target, $0.frame, false) } ?? NSScreen.screens[0]
let screenIndex = NSScreen.screens.firstIndex(of: screen) ?? 0
let side: CGFloat = 80
let frame = NSRect(x: screen.frame.maxX - side - 20, y: screen.frame.maxY - side - 60, width: side, height: side)
let panel = NSPanel(contentRect: frame, styleMask: [.borderless, .nonactivatingPanel], backing: .buffered, defer: false)
panel.level = .screenSaver
panel.ignoresMouseEvents = true
panel.collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary, .stationary]
guard let device = MTLCreateSystemDefaultDevice(), let queue = device.makeCommandQueue() else {
say("no Metal device")
exit(1)
}
let layer = CAMetalLayer()
layer.device = device
layer.pixelFormat = .rgba16Float
layer.wantsExtendedDynamicRangeContent = hdr
layer.colorspace = CGColorSpace(name: hdr ? CGColorSpace.extendedLinearDisplayP3 : CGColorSpace.displayP3)
layer.contentsScale = screen.backingScaleFactor
layer.drawableSize = CGSize(width: side * screen.backingScaleFactor, height: side * screen.backingScaleFactor)
let view = NSView(frame: NSRect(origin: .zero, size: frame.size))
view.layer = layer
view.wantsLayer = true
panel.contentView = view
func draw() {
guard let drawable = layer.nextDrawable(), let commands = queue.makeCommandBuffer() else { return }
let pass = MTLRenderPassDescriptor()
pass.colorAttachments[0].texture = drawable.texture
pass.colorAttachments[0].loadAction = .clear
pass.colorAttachments[0].storeAction = .store
let level = hdr ? 2.0 : 1.0 // 2.0 = twice SDR white
pass.colorAttachments[0].clearColor = MTLClearColor(red: level, green: level, blue: level, alpha: 1)
commands.makeRenderCommandEncoder(descriptor: pass)?.endEncoding()
commands.present(drawable)
commands.commit()
}
say("headroom: \(headroom()); showing an \(hdr ? "HDR" : "SDR") patch in \(delay) s for \(showFor) s")
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
panel.orderFrontRegardless()
draw()
say("\(hdr ? "HDR" : "SDR") patch shown on screen \(screenIndex)")
DispatchQueue.main.asyncAfter(deadline: .now() + showFor) {
panel.orderOut(nil)
say("patch hidden")
DispatchQueue.main.asyncAfter(deadline: .now() + 8) {
endBurst()
say("done: \(notifications) screen-parameters notifications")
exit(0)
}
}
}
app.run() -
Optional, to see Lightroom close the window: in a second Terminal window, run:
log stream --info --predicate 'process == "Adobe Lightroom" AND category == "Window"' -
With the mouse pointer on the display Lightroom is on (the patch appears on that display), run in Terminal:
swift edr_pulse.swift 10Wait for it to print "showing an HDR patch in 10.0 s for 2.0 s".
-
Within those 10 s, switch to Lightroom and press F to open Survey's full screen.
-
When the patch appears in the top right of the display, Survey's full screen fades out and closes within about 0.4 s, and Lightroom's main window comes back. Terminal prints "screen parameters changed" and then about 120 notifications in that burst. The log stream from step 3 shows
window <AgPanel: …> windowNumber=N finishing close. -
Control: repeat steps 4 and 5 with
swift edr_pulse.swift 10 2 sdr, the same patch without HDR. Terminal prints "done: 0 screen-parameters notifications", and full screen stays open. Press Esc to leave it.
The Expected Result
- Survey - Full Screen stays open when a display's HDR headroom changes. It closes when the user leaves it (Esc or F), switches to another app, or a dialog opens.
- On "displayChanged", Survey - Full Screen does what Detail - Full Screen does: it checks whether its screen's size or arrangement changed and adjusts its window only then. Or AgUI posts "displayChanged" only when a screen's frame or arrangement changed, not on a headroom change.
The Actual Result
- On command, 2026-11-16, Survey full screen on the external HDR display, the HDR patch on the same display:
- The patch appeared at 18:17:31.984. The helper got its first screen-parameters notification at 18:17:32.016, and 124 in all. Meanwhile WindowServer logged ("commitBrightness … headroom") the built-in display's headroom rising from 1.21 to 4.61 over 1 s, and the external display's going from 1.20 to 2.38.
- Lightroom logged
window <AgPanel: …> windowNumber=226 finishing closeat 18:17:32.274. The full-screen window left the screen at 18:17:32.347, 0.364 s after the patch appeared. An earlier run: 0.374 s. - Control, the same patch without HDR: 0 notifications, and full screen stayed open until F was pressed 4 s later.
- In normal use, 2026-11-16 02:25–02:27, on the built-in XDR display, five Survey full-screen windows were opened with F:
- Three closed by themselves, 0.37–0.38 s after the headroom started to change, with no key press or app switch: two during one ramp from 6.74 down to 1.2 (the second opened during that ramp), one during a ramp from 6.73 down to 1.2. They had been open 1.6 s, 0.4 s and 7.9 s.
- One closed 0.375 s after a key press, and one 0.374 s after switching to another app. These two had seen no headroom change and stayed open until then: 6.2 s and 19.9 s.
System Details
- Lightroom 10.0 (Mac App Store), build 2026.1029.0836, arm64
- macOS 27.2.1 (26B131), MacBook Pro 16" (MacBookPro18,2), Apple M1 Max (10 cores), 64 GB RAM
- Displays: the built-in Liquid Retina XDR display, and an external HDR display (Survey full screen ran on it at 3008 × 1692 points)
