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

A single toplevel window owned by some other Wayland client. More...

#include <phosphor-wayland/include/PhosphorWayland/ForeignToplevel.h>

Inheritance diagram for PhosphorWayland::ForeignToplevel:
[legend]

Signals

void titleChanged ()
 
void appIdChanged ()
 
void stateChanged ()
 
void outputsChanged ()
 
void parentToplevelChanged ()
 
void closedChanged ()
 

Public Member Functions

 ~ForeignToplevel () override
 
QString title () const
 
QString appId () const
 
bool isMaximized () const
 
bool isMinimized () const
 
bool isActivated () const
 
bool isFullscreen () const
 
QList< QScreen * > outputs () const
 
ForeignToplevelparentToplevel () const
 
bool isClosed () const
 
void activate ()
 Request the compositor focus this toplevel.
 
void close ()
 Request the compositor close this toplevel.
 
void setMaximized (bool maximized)
 
void setMinimized (bool minimized)
 
void setFullscreen (bool fullscreen, QScreen *output=nullptr)
 Toggle fullscreen on the given output (null = compositor's choice).
 
void setRectangle (QWindow *surface, const QRect &rect)
 Tell the compositor where on screen this toplevel's representation lives (e.g.
 

Detailed Description

A single toplevel window owned by some other Wayland client.

Surfaces the protocol's title / app_id / state / output / parent events as Q_PROPERTYs and the activate / close / set_maximized / set_minimized / set_fullscreen / set_rectangle requests as Q_INVOKABLE methods. Owned by ForeignToplevelManager; never construct directly.

State changes are coalesced — the protocol sends a done event after a batch of property updates, and we only fire the change signals at that point. This matches xdg-shell's configure semantics and lets QML bindings re-evaluate once per logical update instead of N times per frame for active windows that get rapid updates.

Constructor & Destructor Documentation

◆ ~ForeignToplevel()

PhosphorWayland::ForeignToplevel::~ForeignToplevel ( )
override

Member Function Documentation

◆ activate()

void PhosphorWayland::ForeignToplevel::activate ( )

Request the compositor focus this toplevel.

Always uses the first seat returned by Qt's QtWaylandClient::QWaylandDisplay (typically the only seat on single-user systems). Multi-seat selection is not currently exposed — adding a QObject* seat parameter would be a future API extension if a real consumer needs it.

◆ appId()

QString PhosphorWayland::ForeignToplevel::appId ( ) const

◆ appIdChanged

void PhosphorWayland::ForeignToplevel::appIdChanged ( )
signal

◆ close()

void PhosphorWayland::ForeignToplevel::close ( )

Request the compositor close this toplevel.

Equivalent to clicking the X button — the owning client decides whether to honour it (some show "save changes?" dialogs first).

◆ closedChanged

void PhosphorWayland::ForeignToplevel::closedChanged ( )
signal

◆ isActivated()

bool PhosphorWayland::ForeignToplevel::isActivated ( ) const

◆ isClosed()

bool PhosphorWayland::ForeignToplevel::isClosed ( ) const

◆ isFullscreen()

bool PhosphorWayland::ForeignToplevel::isFullscreen ( ) const

◆ isMaximized()

bool PhosphorWayland::ForeignToplevel::isMaximized ( ) const

◆ isMinimized()

bool PhosphorWayland::ForeignToplevel::isMinimized ( ) const

◆ outputs()

QList< QScreen * > PhosphorWayland::ForeignToplevel::outputs ( ) const

◆ outputsChanged

void PhosphorWayland::ForeignToplevel::outputsChanged ( )
signal

◆ parentToplevel()

ForeignToplevel * PhosphorWayland::ForeignToplevel::parentToplevel ( ) const

◆ parentToplevelChanged

void PhosphorWayland::ForeignToplevel::parentToplevelChanged ( )
signal

◆ setFullscreen()

void PhosphorWayland::ForeignToplevel::setFullscreen ( bool  fullscreen,
QScreen *  output = nullptr 
)

Toggle fullscreen on the given output (null = compositor's choice).

output is silently ignored when fullscreen=false — the protocol has separate set/unset requests and unset_fullscreen carries no output argument. Requires zwlr_foreign_toplevel_manager_v1 version >= 2; on older compositors this is silently a no-op.

◆ setMaximized()

void PhosphorWayland::ForeignToplevel::setMaximized ( bool  maximized)

◆ setMinimized()

void PhosphorWayland::ForeignToplevel::setMinimized ( bool  minimized)

◆ setRectangle()

void PhosphorWayland::ForeignToplevel::setRectangle ( QWindow *  surface,
const QRect &  rect 
)

Tell the compositor where on screen this toplevel's representation lives (e.g.

its taskbar entry). The compositor uses this to anchor minimize / unminimize animations. surface must be a QWindow that's currently mapped to a wl_surface; the rectangle is surface-local (not screen-local). QML callers wanting to anchor to a QQuickItem should pass item.Window.window and pre-map the rect via mapToScene().

◆ stateChanged

void PhosphorWayland::ForeignToplevel::stateChanged ( )
signal

◆ title()

QString PhosphorWayland::ForeignToplevel::title ( ) const

◆ titleChanged

void PhosphorWayland::ForeignToplevel::titleChanged ( )
signal

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