scripting: Provide clientArea() overloads that take VirtualDesktop objects

This commit is contained in:
Vlad Zahorodnii 2022-03-29 13:23:44 +03:00
parent 601ef328df
commit 66850e62a0
2 changed files with 17 additions and 2 deletions

View file

@ -270,6 +270,11 @@ QRect WorkspaceWrapper::clientArea(ClientAreaOption option, const QPoint &p, int
return Workspace::self()->clientArea(static_cast<clientAreaOption>(option), output, virtualDesktop);
}
QRect WorkspaceWrapper::clientArea(ClientAreaOption option, const QPoint &p, VirtualDesktop *desktop) const
{
return workspace()->clientArea(static_cast<clientAreaOption>(option), kwinApp()->platform()->outputAt(p), desktop);
}
QRect WorkspaceWrapper::clientArea(ClientAreaOption option, const KWin::AbstractClient *c) const
{
return Workspace::self()->clientArea(static_cast<clientAreaOption>(option), c);
@ -302,6 +307,11 @@ QRect WorkspaceWrapper::clientArea(ClientAreaOption option, int screen, int desk
return workspace()->clientArea(static_cast<clientAreaOption>(option), output, virtualDesktop);
}
QRect WorkspaceWrapper::clientArea(ClientAreaOption option, AbstractOutput *output, VirtualDesktop *desktop) const
{
return workspace()->clientArea(static_cast<clientAreaOption>(option), output, desktop);
}
QString WorkspaceWrapper::desktopName(int desktop) const
{
const VirtualDesktop *vd = VirtualDesktopManager::self()->desktopForX11Id(desktop);

View file

@ -22,6 +22,7 @@ namespace KWin
{
// forward declarations
class AbstractClient;
class AbstractOutput;
class VirtualDesktop;
class X11Client;
@ -241,16 +242,20 @@ public:
* @param screen The screen for which the area should be considered
* @param desktop The desktop for which the area should be considered, in general there should not be a difference
* @returns The specified screen geometry
* @deprecated use clientArea(ClientAreaOption option, KWin::AbstractOutput *output, KWin::VirtualDesktop *desktop)
*/
Q_SCRIPTABLE QRect clientArea(ClientAreaOption option, int screen, int desktop) const;
Q_SCRIPTABLE QRect clientArea(ClientAreaOption option, int screen, int desktop) const; // TODO Plasma 6: Drop
Q_SCRIPTABLE QRect clientArea(ClientAreaOption option, KWin::AbstractOutput *output, KWin::VirtualDesktop *desktop) const;
/**
* Overloaded method for convenience.
* @param option The type of area which should be considered
* @param point The coordinates which have to be included in the area
* @param desktop The desktop for which the area should be considered, in general there should not be a difference
* @returns The specified screen geometry
* @deprecated use clientArea(ClientAreaOption option, const QPoint &point, KWin::VirtualDesktop *desktop)
*/
Q_SCRIPTABLE QRect clientArea(ClientAreaOption option, const QPoint &point, int desktop) const;
Q_SCRIPTABLE QRect clientArea(ClientAreaOption option, const QPoint &point, int desktop) const; // TODO Plasma 6: Drop
Q_SCRIPTABLE QRect clientArea(ClientAreaOption option, const QPoint &point, KWin::VirtualDesktop *desktop) const;
/**
* Overloaded method for convenience.
* @param client The Client for which the area should be retrieved