Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorWayland::LockSurface Class Reference

Marks a QWindow as an ext_session_lock_surface_v1 for one output. More...

#include <PhosphorWayland/LockSurface.h>

Inheritance diagram for PhosphorWayland::LockSurface:
[legend]

Signals

void screenChanged ()
void configuredChanged ()

Public Member Functions

 ~LockSurface () override
void setScreen (QScreen *screen)
 The output this lock surface covers.
QScreen * screen () const
bool isConfigured () const
 True once the compositor has sized the surface and the window has taken that size.

Static Public Member Functions

static LockSurface * get (QWindow *window)
 Get or create the LockSurface for window.
static LockSurface * find (QWindow *window)
 The existing LockSurface for window, or nullptr.
static bool isSupported ()
 True iff the compositor advertises ext_session_lock_manager_v1.

Detailed Description

Marks a QWindow as an ext_session_lock_surface_v1 for one output.

Pure Qt API, no Wayland types exposed. Call get() on a not-yet-shown window and set its screen; when the window is shown the QPA plugin creates the lock surface against the ext_session_lock_v1 that SessionLock currently holds, on the wl_output behind screen(). The compositor then sends the surface's exact size in a configure, which the plugin acks and applies to the window before its first frame; configured turns true once that has happened.

A lock surface can only exist while a lock is held or in flight (SessionLock::canCreateSurfaces()): shown outside that window, the QWindow gets no shell role and stays unmapped, which is the protocol's own answer. The compositor unmaps every lock surface when the lock is released; the window should then be hidden (destroying the surface) rather than reused.

One per window, parented to it. Threading: GUI thread only.

Constructor & Destructor Documentation

◆ ~LockSurface()

PhosphorWayland::LockSurface::~LockSurface ( )
override

Member Function Documentation

◆ configuredChanged

void PhosphorWayland::LockSurface::configuredChanged ( )
signal

◆ find()

LockSurface * PhosphorWayland::LockSurface::find ( QWindow * window)
static

The existing LockSurface for window, or nullptr.

◆ get()

LockSurface * PhosphorWayland::LockSurface::get ( QWindow * window)
static

Get or create the LockSurface for window.

Must be called BEFORE the window's first show(); returns nullptr when the window is already visible (its platform window has a different role by then).

◆ isConfigured()

bool PhosphorWayland::LockSurface::isConfigured ( ) const
nodiscard

True once the compositor has sized the surface and the window has taken that size.

◆ isSupported()

bool PhosphorWayland::LockSurface::isSupported ( )
static

True iff the compositor advertises ext_session_lock_manager_v1.

◆ screen()

QScreen * PhosphorWayland::LockSurface::screen ( ) const
nodiscard

◆ screenChanged

void PhosphorWayland::LockSurface::screenChanged ( )
signal

◆ setScreen()

void PhosphorWayland::LockSurface::setScreen ( QScreen * screen)

The output this lock surface covers.

Immutable once the window is shown (the wl_output is bound at surface creation). A null screen resolves to the primary one.


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