Apps sometimes need to know whether their window is actually visible to the user, not just shown but covered by other windows, for example to pause rendering or video.
Proposal: an occlusion state and event. macOS has it natively (NSWindow.occlusionState / NSWindowDidChangeOcclusionStateNotification); on Windows it can be approximated (DwmGetWindowAttribute(DWMWA_CLOAKED) plus a z-order/visible-region check), and on Linux via visibility-notify-event on X11 only.
Background:
Apps sometimes need to know whether their window is actually visible to the user, not just shown but covered by other windows, for example to pause rendering or video.
Proposal: an occlusion state and event. macOS has it natively (
NSWindow.occlusionState/NSWindowDidChangeOcclusionStateNotification); on Windows it can be approximated (DwmGetWindowAttribute(DWMWA_CLOAKED)plus a z-order/visible-region check), and on Linux viavisibility-notify-eventon X11 only.Background: