Vixen
02b45cc4
csharp
public interface IDisplayInfo

What displays exist and what they can do.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Everything here is a snapshot. Displays are hot-pluggable, a laptop lid closing removes one, and a scale change rewrites all of them — so a DisplaysChanged invalidates anything cached from this interface, and code that stored a DisplayInfo at boot is code that has a bug on a docking station.

Absent entirely on a headless platform, where Displays is empty. That is a legal state, not an error: a dedicated server has no displays and asking it for one should give an empty list rather than an exception, so the caller's fallback path is the ordinary path.

Fields and properties (2)

  • IReadOnlyList<DisplayInfo> Displays

    Every display, in the platform's order. Empty when there are none.

  • DisplayInfo? Primary

    The display the OS considers primary, or when there are none.

Methods (2)

  • bool TryGetForWindow(IWindow window, out DisplayInfo? display)

    Finds the display a window is mostly on.

  • bool TryGetForPoint(Int2 point, out DisplayInfo? display)

    Finds the display containing a point in desktop coordinates.

Used by (7)

  • DesktopDisplaysVixen.Platform.Desktop
  • DesktopPlatformVixen.Platform.Desktop
  • HeadlessDisplaysVixen.Platform.Headless
  • HeadlessPlatformVixen.Platform.Headless
  • HeadlessPlatformTestsVixen.Platform.Headless.Tests
  • IPlatformVixen.Platform
  • PlatformWindowHostVixen.Platform.Ui