scripting: Drop clientArea(area, QPoint, VirtualDesktop) overload

Use Workspace.screenAt() to look up the output instead.
This commit is contained in:
Vlad Zahorodnii 2023-02-08 20:01:38 +02:00
parent fa2b854ee4
commit 37f4199b19
3 changed files with 1 additions and 14 deletions

View file

@ -76,7 +76,7 @@ Window {
height: 0 height: 0
enabledBorders: { enabledBorders: {
var maximizedArea = Workspace.clientArea(Workspace.MaximizeArea, Qt.point(outline.geometry.x, outline.geometry.y), Workspace.currentDesktop); var maximizedArea = Workspace.clientArea(Workspace.MaximizeArea, Workspace.screenAt(Qt.point(outline.geometry.x, outline.geometry.y)), Workspace.currentDesktop);
var left = outline.geometry.x === maximizedArea.x; var left = outline.geometry.x === maximizedArea.x;
var right = outline.geometry.x + outline.geometry.width === maximizedArea.x + maximizedArea.width; var right = outline.geometry.x + outline.geometry.width === maximizedArea.x + maximizedArea.width;

View file

@ -228,11 +228,6 @@ QSize WorkspaceWrapper::workspaceSize() const
return QSize(workspaceWidth(), workspaceHeight()); return QSize(workspaceWidth(), workspaceHeight());
} }
QRectF WorkspaceWrapper::clientArea(ClientAreaOption option, const QPoint &p, VirtualDesktop *desktop) const
{
return workspace()->clientArea(static_cast<clientAreaOption>(option), workspace()->outputAt(p), desktop);
}
QRectF WorkspaceWrapper::clientArea(ClientAreaOption option, const KWin::Window *c) const QRectF WorkspaceWrapper::clientArea(ClientAreaOption option, const KWin::Window *c) const
{ {
if (!c) { if (!c) {

View file

@ -210,14 +210,6 @@ public:
* @returns The specified screen geometry * @returns The specified screen geometry
*/ */
Q_SCRIPTABLE QRectF clientArea(ClientAreaOption option, KWin::Output *output, KWin::VirtualDesktop *desktop) const; Q_SCRIPTABLE QRectF clientArea(ClientAreaOption option, KWin::Output *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
*/
Q_SCRIPTABLE QRectF clientArea(ClientAreaOption option, const QPoint &point, KWin::VirtualDesktop *desktop) const;
/** /**
* Overloaded method for convenience. * Overloaded method for convenience.
* @param client The Client for which the area should be retrieved * @param client The Client for which the area should be retrieved