From 35fe3cb6c5a8568e7f143cb5bfb145df1ec3fad7 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 28 Jan 2020 20:45:58 +0200 Subject: [PATCH] Drop Toplevel::decorationRect() Summary: It's identical to Toplevel::rect(). Test Plan: Compiles. Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D26971 --- deleted.cpp | 5 ----- deleted.h | 1 - plugins/scenes/xrender/scene_xrender.cpp | 2 +- scene.cpp | 2 +- toplevel.cpp | 5 ----- toplevel.h | 6 ++++-- x11client.cpp | 5 ----- x11client.h | 3 --- 8 files changed, 6 insertions(+), 23 deletions(-) diff --git a/deleted.cpp b/deleted.cpp index 2dbced2739..cee6bebaad 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -224,11 +224,6 @@ void Deleted::layoutDecorationRects(QRect& left, QRect& top, QRect& right, QRect bottom = decoration_bottom; } -QRect Deleted::decorationRect() const -{ - return rect(); -} - QRect Deleted::transparentRect() const { return transparent_rect; diff --git a/deleted.h b/deleted.h index bb7fe2f94c..22757677ca 100644 --- a/deleted.h +++ b/deleted.h @@ -62,7 +62,6 @@ public: return no_border; } void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const; - QRect decorationRect() const override; Layer layer() const override { return m_layer; } diff --git a/plugins/scenes/xrender/scene_xrender.cpp b/plugins/scenes/xrender/scene_xrender.cpp index acab174a56..e454244537 100644 --- a/plugins/scenes/xrender/scene_xrender.cpp +++ b/plugins/scenes/xrender/scene_xrender.cpp @@ -464,7 +464,7 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat X11Client *client = dynamic_cast(toplevel); Deleted *deleted = dynamic_cast(toplevel); - const QRect decorationRect = toplevel->decorationRect(); + const QRect decorationRect = toplevel->rect(); if (((client && !client->noBorder()) || (deleted && !deleted->noBorder())) && true) { // decorated client diff --git a/scene.cpp b/scene.cpp index f8facec29d..80ff338175 100644 --- a/scene.cpp +++ b/scene.cpp @@ -788,7 +788,7 @@ QRegion Scene::Window::clientShape() const QRegion Scene::Window::decorationShape() const { - return QRegion(toplevel->decorationRect()) - toplevel->transparentRect(); + return QRegion(toplevel->rect()) - toplevel->transparentRect(); } QPoint Scene::Window::bufferOffset() const diff --git a/toplevel.cpp b/toplevel.cpp index ca83f72d51..33c9020122 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -75,11 +75,6 @@ QDebug& operator<<(QDebug& stream, const Toplevel* cl) return stream; } -QRect Toplevel::decorationRect() const -{ - return rect(); -} - void Toplevel::detectShape(xcb_window_t id) { const bool wasShape = is_shape; diff --git a/toplevel.h b/toplevel.h index 3dea3204b5..2cf6bbc0ee 100644 --- a/toplevel.h +++ b/toplevel.h @@ -376,8 +376,10 @@ public: */ virtual QPoint clientContentPos() const; virtual QSize clientSize() const = 0; - virtual QRect visibleRect() const; // the area the window occupies on the screen - virtual QRect decorationRect() const; // rect including the decoration shadows + /** + * Returns a rectangle that the window occupies on the screen, including drop-shadows. + */ + virtual QRect visibleRect() const; virtual QRect transparentRect() const = 0; virtual bool isClient() const; virtual bool isDeleted() const; diff --git a/x11client.cpp b/x11client.cpp index 0815d5b96f..de643c904d 100644 --- a/x11client.cpp +++ b/x11client.cpp @@ -2562,11 +2562,6 @@ void X11Client::setSessionActivityOverride(bool needed) updateActivities(false); } -QRect X11Client::decorationRect() const -{ - return QRect(0, 0, width(), height()); -} - Xcb::Property X11Client::fetchFirstInTabBox() const { return Xcb::Property(false, m_client, atoms->kde_first_in_window_list, diff --git a/x11client.h b/x11client.h index e43d527f63..65c4197e32 100644 --- a/x11client.h +++ b/x11client.h @@ -271,9 +271,6 @@ public: */ bool hasOffscreenXineramaStrut() const; - // Decorations <-> Effects - QRect decorationRect() const override; - QRect transparentRect() const override; bool isClientSideDecorated() const;