Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
Phosphor::Screens::PhysicalScreen Struct Reference

A physical output as ScreenManager sees it — decoupled from QScreen. More...

#include <phosphor-screens/include/PhosphorScreens/PhysicalScreen.h>

Public Member Functions

bool isValid () const
 A screen with no connector name is the null/absent value.
 
bool operator== (const PhysicalScreen &other) const
 Identity is the connector — see the class note.
 
bool operator!= (const PhysicalScreen &other) const
 

Public Attributes

QString name
 Connector name (e.g. "DP-3", "HDMI-A-1") — QScreen::name().
 
QString identifier
 Stable EDID-aware identifier from ScreenIdentity (e.g.
 
QRect geometry
 Output geometry in the global desktop coordinate space.
 
QScreen * qscreen = nullptr
 Underlying QScreen, or nullptr for a synthetic (test) screen.
 

Detailed Description

A physical output as ScreenManager sees it — decoupled from QScreen.

ScreenManager operates on PhysicalScreen values rather than QScreen pointers so the screen add / remove / move / resize sequence can be driven by a fake in tests (QScreen cannot be instantiated by non- platform code). The production IScreenProvider wraps real QScreens and fills qscreen; a test provider synthesizes screens with arbitrary geometry and leaves qscreen null.

This is a value snapshot, not a live handle. IScreenProvider emits a fresh PhysicalScreen with every screenGeometryChanged, and ScreenManager replaces its stored copy — so a stored PhysicalScreen is current as long as the manager keeps up with the provider's signals, which it does.

Identity is the connector name: it is unique among connected outputs and stable for the life of a connection (geometry and even the EDID-derived identifier can change under it; the connector does not). Equality and hashing key on it.

Member Function Documentation

◆ isValid()

bool Phosphor::Screens::PhysicalScreen::isValid ( ) const
inline

A screen with no connector name is the null/absent value.

◆ operator!=()

bool Phosphor::Screens::PhysicalScreen::operator!= ( const PhysicalScreen other) const
inline

◆ operator==()

bool Phosphor::Screens::PhysicalScreen::operator== ( const PhysicalScreen other) const
inline

Identity is the connector — see the class note.

Member Data Documentation

◆ geometry

QRect Phosphor::Screens::PhysicalScreen::geometry

Output geometry in the global desktop coordinate space.

◆ identifier

QString Phosphor::Screens::PhysicalScreen::identifier

Stable EDID-aware identifier from ScreenIdentity (e.g.

"Manuf:Model:Serial" or "Manuf:Model:Serial/CONNECTOR"). May be empty for a synthetic test screen that opts out of identity.

◆ name

QString Phosphor::Screens::PhysicalScreen::name

Connector name (e.g. "DP-3", "HDMI-A-1") — QScreen::name().

◆ qscreen

QScreen* Phosphor::Screens::PhysicalScreen::qscreen = nullptr

Underlying QScreen, or nullptr for a synthetic (test) screen.

Consumers that genuinely need the QScreen — to parent a window to an output, say — read this; null-check it.


The documentation for this struct was generated from the following file: