diff --git a/autotests/test_window_paint_data.cpp b/autotests/test_window_paint_data.cpp --- a/autotests/test_window_paint_data.cpp +++ b/autotests/test_window_paint_data.cpp @@ -107,6 +107,12 @@ 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.h b/effects.h --- a/effects.h +++ b/effects.h @@ -406,6 +406,8 @@ QSize basicUnit() const override; QRect geometry() const override; + QRect frameGeometry() const override; + QRect bufferGeometry() const override; QString caption() const override; diff --git a/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -1828,6 +1828,8 @@ 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/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -2192,7 +2192,28 @@ * 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.