Why does the macOS window sharing indicator appear for some windows but not others?

On recent versions of macOS, when a window is being shared (via the system screen-capture APIs), the OS sometimes shows a small "shared window" badge in the title bar.

I’ve noticed that this indicator is not consistent:

  • For some windows, the badge reliably appears when they are being shared.
  • For other windows, the badge never appears, even though the window is actively shared.

In particular, windows that use a standard system title bar seem to show the indicator more often, while windows with custom-drawn or non-standard chrome do not.

My questions are:

  1. What are the exact conditions under which macOS decides to draw the “shared window” indicator in a window’s title bar?

  2. Is this strictly tied to certain NSWindow styles or masks (e.g. titled vs borderless)?

  3. Is there any API or flag I can use to detect programmatically whether a given window will display this system indicator when shared?

Why does the macOS window sharing indicator appear for some windows but not others?
 
 
Q