[libkwineffects] Expose frame and buffer geometry to effects

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10867

Differential Revision: https://phabricator.kde.org/D24459
This commit is contained in:
Vlad Zahorodnii 2019-09-28 18:09:12 +03:00
parent 79f4168fd6
commit 28b3b8f0d0
4 changed files with 31 additions and 0 deletions

View file

@ -107,6 +107,12 @@ public:
QRect expandedGeometry() const override {
return QRect();
}
QRect frameGeometry() const override {
return QRect();
}
QRect bufferGeometry() const override {
return QRect();
}
int screen() const override {
return 0;
}

View file

@ -1828,6 +1828,8 @@ TOPLEVEL_HELPER(QPoint, pos, pos)
TOPLEVEL_HELPER(QSize, size, size)
TOPLEVEL_HELPER(int, screen, screen)
TOPLEVEL_HELPER(QRect, geometry, frameGeometry)
TOPLEVEL_HELPER(QRect, frameGeometry, frameGeometry)
TOPLEVEL_HELPER(QRect, bufferGeometry, bufferGeometry)
TOPLEVEL_HELPER(QRect, expandedGeometry, visibleRect)
TOPLEVEL_HELPER(QRect, rect, rect)
TOPLEVEL_HELPER(int, desktop, desktop)

View file

@ -406,6 +406,8 @@ public:
QSize basicUnit() const override;
QRect geometry() const override;
QRect frameGeometry() const override;
QRect bufferGeometry() const override;
QString caption() const override;

View file

@ -2192,7 +2192,28 @@ public:
* MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all.
*/
virtual QSize basicUnit() const = 0;
/**
* @deprecated Use frameGeometry() instead.
*/
virtual QRect geometry() const = 0;
/**
* Returns the geometry of the window excluding server-side and client-side
* drop-shadows.
*
* @since 5.18
*/
virtual QRect frameGeometry() const = 0;
/**
* Returns the geometry of the pixmap or buffer attached to this window.
*
* For X11 clients, this method returns server-side geometry of the Toplevel.
*
* For Wayland clients, this method returns rectangle that the main surface
* occupies on the screen, in global screen coordinates.
*
* @since 5.18
*/
virtual QRect bufferGeometry() const = 0;
/**
* Geometry of the window including decoration and potentially shadows.
* May be different from geometry() if the window has a shadow.