GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Exclude software-dimming overlay windows from screen capture by compoundworks · Pull Request #1877 · MonitorControl/MonitorControl

Conversation

@compoundworks

@compoundworks compoundworks commented Jun 27, 2026

Copy link
Copy Markdown

Problem

When a display is dimmed using software dimming (the black "shade" overlay), screenshots and screen recordings of that display come out darkened — the capture includes the dimming overlay. This is most visible on displays that have no DDC and no gamma support, such as DisplayLink / virtual displays, where the shade overlay is the only dimming mechanism available.

Reported in:

  • Screenshots come up blank when brightness dimmed #1453 (Screenshots come up blank/dark when brightness dimmed)
  • Screenshot from external screen is dimmer when MonitorControl is set to `Avoid gamma table manipulation`? #866 (Screenshot from external screen is dimmer with "Avoid gamma table manipulation")
  • Screenshots come up blank when brightness dimmed #1446

Root cause

DisplayManager.createShadeOnDisplay(...) creates a full‑screen black NSWindow to act as the dimming shade, but never sets its sharingType. The default is .readOnly, so the shade window is visible to the screen‑capture system (CGWindowList / ScreenCaptureKit). Any screenshot or recording taken while a display is dimmed therefore captures the shade and looks dark. The same applies to the 1×1 gammaActivityEnforcer helper window.

Fix

Set sharingType = .none on the shade windows and the gamma activity enforcer. These windows are display‑only chrome; excluding them from capture does not change what the user sees on screen — the display stays visibly dimmed, but captures are taken from the content underneath.

shade.sharingType = .none
self.gammaActivityEnforcer.sharingType = .none

Verification (macOS 15, DisplayLink displays)

Enumerated MonitorControl's on‑screen windows via CGWindowListCopyWindowInfo and read kCGWindowSharingState:

Window Before (main) After (this PR)
Window Shade for Display (full‑screen) 1 (ReadOnly → captured) 0 (None → excluded)
Gamma Activity Enforcer 1 (captured) 0 (excluded)

With the fix, the dimmed display still looks dimmed to the eye, but screencapture of that display no longer includes the shade — screenshots come out at normal brightness. An isolated test window with sharingType = .none confirmed it is excluded from capture (content behind shows through) rather than rendered black.

No behavior change for users who don't use software dimming.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
compoundworks added 2 commits June 27, 2026 12:03
@compoundworks
fix: exclude software-dimming overlay windows from screen capture
ed07a0c
For displays without DDC or gamma support (e.g. DisplayLink / virtual
displays), MonitorControl dims via a full-screen black 'shade' NSWindow.
Because the shade window's sharingType defaults to .readOnly, it is
captured by screenshots and screen recordings, so any capture taken
while a display is dimmed comes out darkened (see discussions MonitorControl#1453,
MonitorControl#866, MonitorControl#1446).

Set sharingType = .none on the shade windows and the gamma activity
enforcer so they no longer appear in screen captures. This is
display-only chrome; excluding it from capture does not change what the
user sees on screen.
@compoundworks
Only exclude shade from capture on non-virtual displays
4d62fa9
Virtual displays (AirPlay/Sidecar/DisplayLink) are themselves presented
to the physical monitor via screen capture. Setting sharingType=.none on
their shade would remove the dimming from the actual monitor, not just
from screenshots. Guard the opt-out with !isVirtual so DisplayLink etc.
keep dimming, while real displays using shade (e.g. Mac mini HDMI) still
get screenshot-clean dimming.
@compoundworks

compoundworks commented Jun 27, 2026

Copy link
Copy Markdown
Author

Revised: limited the sharingType = .none opt-out to non-virtual displays. On virtual displays (AirPlay / Sidecar / DisplayLink) the OS composites the display itself through screen capture, so excluding the shade from capture also removes the dimming from the physical monitor. Real displays using shade dimming (e.g. Mac mini HDMI / blacklisted) still benefit; virtual displays keep their existing behavior.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waydabber waydabber added the AI contribution / fork recommendation Unplanned PR (typically AI) with improvements which may be of interest to the community label Jun 27, 2026
@ankitdhandharia ankitdhandharia mentioned this pull request Sep 23, 2026
docs: add Troubleshooting section for dim screen captures and slider brightness jump #1913
Open

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

AI contribution / fork recommendation Unplanned PR (typically AI) with improvements which may be of interest to the community

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@compoundworks @waydabber
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.