Client-side wrapper around zwlr_foreign_toplevel_manager_v1.
More...
#include <phosphor-wayland/include/PhosphorWayland/ForeignToplevel.h>
Signals | |
| void | toplevelAdded (PhosphorWayland::ForeignToplevel *toplevel) |
| void | toplevelRemoved (PhosphorWayland::ForeignToplevel *toplevel) |
Public Member Functions | |
| ForeignToplevelManager (QObject *parent=nullptr) | |
| ~ForeignToplevelManager () override | |
| QList< ForeignToplevel * > | toplevels () const |
| Snapshot of the current toplevel set. | |
| void | stop () |
| Stop receiving events. | |
Static Public Member Functions | |
| static bool | isSupported () |
True iff the compositor advertises zwlr_foreign_toplevel_manager_v1. | |
Client-side wrapper around zwlr_foreign_toplevel_manager_v1.
Lists every toplevel window from every Wayland client connected to the compositor and lets the consumer subscribe to add / remove events. Owns one ForeignToplevel per window. Suitable for taskbars, window-lists, window switchers, IME candidate lists, etc.
Construct one per process — the manager binds the protocol global on the first instance and Wayland keeps a per-binding event stream, so a second binding would receive a duplicate stream of toplevels.
Threading: every method MUST be called from the GUI thread.
Lifecycle: ForeignToplevel objects are owned by the manager and live until the compositor sends closed (or the manager is destroyed). The toplevelRemoved signal fires immediately before the ForeignToplevel is deleteLater()'d. Don't dereference a ForeignToplevel from a slot fired by toplevelRemoved — capture by ID instead.
|
explicit |
|
override |
|
static |
True iff the compositor advertises zwlr_foreign_toplevel_manager_v1.
Check this before constructing — the constructor still succeeds on unsupported compositors but signals nothing.
| void PhosphorWayland::ForeignToplevelManager::stop | ( | ) |
Stop receiving events.
After this the manager will not emit toplevelAdded. Existing ForeignToplevel handles remain valid until the compositor closes them or this object is destroyed. Idempotent.
|
signal |
|
signal |
| QList< ForeignToplevel * > PhosphorWayland::ForeignToplevelManager::toplevels | ( | ) | const |
Snapshot of the current toplevel set.
Pointers stay live until the matching toplevelRemoved signal fires; never null inside the list.