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

#include <phosphor-workspaces/include/PhosphorWorkspaces/VirtualDesktopManager.h>

Inheritance diagram for PhosphorWorkspaces::VirtualDesktopManager:
[legend]

Signals

void currentDesktopChanged (int desktop)
 
void desktopCountChanged (int count)
 
void screenDesktopChanged (const QString &screenId, int desktop)
 A single screen's current virtual desktop changed (per-output virtual desktops).
 

Public Member Functions

 VirtualDesktopManager (QObject *parent=nullptr)
 
 ~VirtualDesktopManager () override
 
bool init ()
 
void start ()
 
void stop ()
 
int currentDesktop () const override
 The global (active-screen) current virtual desktop, 1-based.
 
int currentDesktopForScreen (const QString &screenId) const override
 The current virtual desktop for a specific screen, 1-based.
 
bool perScreenModeActive () const override
 True when at least two screens are on different virtual desktops, i.e.
 
void updateScreenDesktop (const QString &screenId, int desktop)
 Record a screen's current virtual desktop (1-based).
 
void removeScreenDesktop (const QString &screenId)
 Drop a screen's recorded per-output desktop when the output is removed, so the map doesn't retain stale entries (and perScreenModeActive() doesn't keep counting a gone screen) across monitor hot-plug.
 
void setCurrentDesktop (int desktop)
 
int desktopCount () const
 
int desktopRows () const
 Number of rows in KWin's virtual-desktop grid (>= 1).
 
QStringList desktopNames () const
 
- Public Member Functions inherited from PhosphorEngine::IVirtualDesktopManager
virtual ~IVirtualDesktopManager ()=default
 

Constructor & Destructor Documentation

◆ VirtualDesktopManager()

PhosphorWorkspaces::VirtualDesktopManager::VirtualDesktopManager ( QObject *  parent = nullptr)
explicit

◆ ~VirtualDesktopManager()

PhosphorWorkspaces::VirtualDesktopManager::~VirtualDesktopManager ( )
override

Member Function Documentation

◆ currentDesktop()

int PhosphorWorkspaces::VirtualDesktopManager::currentDesktop ( ) const
overridevirtual

The global (active-screen) current virtual desktop, 1-based.

Implements PhosphorEngine::IVirtualDesktopManager.

◆ currentDesktopChanged

void PhosphorWorkspaces::VirtualDesktopManager::currentDesktopChanged ( int  desktop)
signal

◆ currentDesktopForScreen()

int PhosphorWorkspaces::VirtualDesktopManager::currentDesktopForScreen ( const QString &  screenId) const
overridevirtual

The current virtual desktop for a specific screen, 1-based.

Under Plasma 6.7 "switch desktops independently for each screen" (per-output virtual desktops) each screen can be on its own desktop. The default returns the global currentDesktop(), which is correct for single-desktop / pre-6.7 setups and for screens with no per-output desktop on record.

Reimplemented from PhosphorEngine::IVirtualDesktopManager.

◆ desktopCount()

int PhosphorWorkspaces::VirtualDesktopManager::desktopCount ( ) const

◆ desktopCountChanged

void PhosphorWorkspaces::VirtualDesktopManager::desktopCountChanged ( int  count)
signal

◆ desktopNames()

QStringList PhosphorWorkspaces::VirtualDesktopManager::desktopNames ( ) const

◆ desktopRows()

int PhosphorWorkspaces::VirtualDesktopManager::desktopRows ( ) const

Number of rows in KWin's virtual-desktop grid (>= 1).

With the count, this gives the grid shape that cross-desktop directional navigation walks. Defaults to 1 until the first KWin refresh.

◆ init()

bool PhosphorWorkspaces::VirtualDesktopManager::init ( )

◆ perScreenModeActive()

bool PhosphorWorkspaces::VirtualDesktopManager::perScreenModeActive ( ) const
overridevirtual

True when at least two screens are on different virtual desktops, i.e.

per-output virtual desktops are in effect. Default: false.

Reimplemented from PhosphorEngine::IVirtualDesktopManager.

◆ removeScreenDesktop()

void PhosphorWorkspaces::VirtualDesktopManager::removeScreenDesktop ( const QString &  screenId)

Drop a screen's recorded per-output desktop when the output is removed, so the map doesn't retain stale entries (and perScreenModeActive() doesn't keep counting a gone screen) across monitor hot-plug.

Driven by the daemon's screenRemoved handler.

◆ screenDesktopChanged

void PhosphorWorkspaces::VirtualDesktopManager::screenDesktopChanged ( const QString &  screenId,
int  desktop 
)
signal

A single screen's current virtual desktop changed (per-output virtual desktops).

The primary trigger the daemon's per-screen desktop handler subscribes to; in single-desktop mode it is driven the same for every screen so downstream has one code path.

◆ setCurrentDesktop()

void PhosphorWorkspaces::VirtualDesktopManager::setCurrentDesktop ( int  desktop)

◆ start()

void PhosphorWorkspaces::VirtualDesktopManager::start ( )

◆ stop()

void PhosphorWorkspaces::VirtualDesktopManager::stop ( )

◆ updateScreenDesktop()

void PhosphorWorkspaces::VirtualDesktopManager::updateScreenDesktop ( const QString &  screenId,
int  desktop 
)

Record a screen's current virtual desktop (1-based).

This is fed by the KWin effect's per-output desktopChanged report (Plasma 6.7 per-output virtual desktops) — KWin's own D-Bus VirtualDesktopManager interface only exposes the GLOBAL current desktop, so per-screen data arrives this way. Emits screenDesktopChanged only when the value actually changes.


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