diff --git a/autotests/test_window_paint_data.cpp b/autotests/test_window_paint_data.cpp index 54daf05ac3..b645b74466 100644 --- a/autotests/test_window_paint_data.cpp +++ b/autotests/test_window_paint_data.cpp @@ -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; } diff --git a/effects.cpp b/effects.cpp index b9db6f6a82..a559a5b3e8 100644 --- a/effects.cpp +++ b/effects.cpp @@ -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) diff --git a/effects.h b/effects.h index 5bc717708d..218eff8d0f 100644 --- a/effects.h +++ b/effects.h @@ -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; diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 03fbb3ed99..e3d25d6338 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -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.