From 99d31859496458617eef2e3cfd4f02e6b15021da Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 29 Sep 2019 14:26:04 +0300 Subject: [PATCH] Rename getShadow method to updateShadow Summary: getShadow is not a getter method as it doesn't return a shadow. Test Plan: Compiles. Reviewers: #kwin, romangg Reviewed By: #kwin, romangg Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D24298 --- composite.cpp | 8 ++++---- events.cpp | 2 +- internal_client.cpp | 4 ++-- scene.cpp | 2 +- shadow.cpp | 12 ++++++------ toplevel.cpp | 2 +- toplevel.h | 2 +- x11client.cpp | 4 ++-- xdgshellclient.cpp | 8 ++++---- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/composite.cpp b/composite.cpp index cdf5d65f7e..a95382fb6e 100644 --- a/composite.cpp +++ b/composite.cpp @@ -350,25 +350,25 @@ void Compositor::startupWithWorkspace() for (X11Client *c : Workspace::self()->clientList()) { c->setupCompositing(); - c->getShadow(); + c->updateShadow(); } for (X11Client *c : Workspace::self()->desktopList()) { c->setupCompositing(); } for (Unmanaged *c : Workspace::self()->unmanagedList()) { c->setupCompositing(); - c->getShadow(); + c->updateShadow(); } for (InternalClient *client : workspace()->internalClients()) { client->setupCompositing(); - client->getShadow(); + client->updateShadow(); } if (auto *server = waylandServer()) { const auto clients = server->clients(); for (XdgShellClient *c : clients) { c->setupCompositing(); - c->getShadow(); + c->updateShadow(); } } diff --git a/events.cpp b/events.cpp index e1a9fe28fe..86b86094ad 100644 --- a/events.cpp +++ b/events.cpp @@ -1322,7 +1322,7 @@ void Toplevel::propertyNotifyEvent(xcb_property_notify_event_t *e) if (e->atom == atoms->wm_client_leader) getWmClientLeader(); else if (e->atom == atoms->kde_net_wm_shadow) - getShadow(); + updateShadow(); else if (e->atom == atoms->kde_skip_close_animation) getSkipCloseAnimation(); break; diff --git a/internal_client.cpp b/internal_client.cpp index 5583abbb32..ad5bd54f38 100644 --- a/internal_client.cpp +++ b/internal_client.cpp @@ -431,7 +431,7 @@ void InternalClient::updateDecoration(bool check_workspace_pos, bool force) destroyDecoration(); } - getShadow(); + updateShadow(); if (check_workspace_pos) { checkWorkspacePosition(oldFrameGeometry, -2, oldClientGeometry); @@ -587,7 +587,7 @@ void InternalClient::createDecoration(const QRect &rect) KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this); if (decoration) { QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection); - connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::getShadow); + connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::updateShadow); connect(decoration, &KDecoration2::Decoration::bordersChanged, this, [this]() { GeometryUpdatesBlocker blocker(this); diff --git a/scene.cpp b/scene.cpp index 8ae9347313..ce186a4d02 100644 --- a/scene.cpp +++ b/scene.cpp @@ -407,7 +407,7 @@ void Scene::addToplevel(Toplevel *c) } ); c->effectWindow()->setSceneWindow(w); - c->getShadow(); + c->updateShadow(); w->updateShadow(c->shadow()); connect(c, &Toplevel::shadowChanged, this, [w] { diff --git a/shadow.cpp b/shadow.cpp index ad53ca5ca5..72baea7320 100644 --- a/shadow.cpp +++ b/shadow.cpp @@ -186,18 +186,18 @@ bool Shadow::init(KDecoration2::Decoration *decoration) { if (m_decorationShadow) { // disconnect previous connections - disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::getShadow); - disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::getShadow); - disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::getShadow); + disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::updateShadow); + disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::updateShadow); + disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::updateShadow); } m_decorationShadow = decoration->shadow(); if (!m_decorationShadow) { return false; } // setup connections - all just mapped to recreate - connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::getShadow); - connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::getShadow); - connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::getShadow); + connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::updateShadow); + connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::updateShadow); + connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::updateShadow); const QMargins &p = m_decorationShadow->padding(); m_topOffset = p.top(); diff --git a/toplevel.cpp b/toplevel.cpp index 5367fd0f16..360ae3a00a 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -574,7 +574,7 @@ bool Toplevel::isOnActiveScreen() const return isOnScreen(screens()->current()); } -void Toplevel::getShadow() +void Toplevel::updateShadow() { QRect dirtyRect; // old & new shadow region const QRect oldVisibleRect = visibleRect(); diff --git a/toplevel.h b/toplevel.h index 8efe9fb8e4..8a3fd8699a 100644 --- a/toplevel.h +++ b/toplevel.h @@ -402,7 +402,7 @@ public: * Updates the Shadow associated with this Toplevel from X11 Property. * Call this method when the Property changes or Compositing is started. */ - void getShadow(); + void updateShadow(); /** * Whether the Toplevel currently wants the shadow to be rendered. Default * implementation always returns @c true. diff --git a/x11client.cpp b/x11client.cpp index 825d9da80c..c7355072eb 100644 --- a/x11client.cpp +++ b/x11client.cpp @@ -392,7 +392,7 @@ void X11Client::updateDecoration(bool check_workspace_pos, bool force) createDecoration(oldgeom); } else destroyDecoration(); - getShadow(); + updateShadow(); if (check_workspace_pos) checkWorkspacePosition(oldgeom, -2, oldClientGeom); updateInputWindow(); @@ -405,7 +405,7 @@ void X11Client::createDecoration(const QRect& oldgeom) KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this); if (decoration) { QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection); - connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::getShadow); + connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::updateShadow); connect(decoration, &KDecoration2::Decoration::resizeOnlyBordersChanged, this, &X11Client::updateInputWindow); connect(decoration, &KDecoration2::Decoration::bordersChanged, this, [this]() { diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index d19576342c..762437780f 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -164,8 +164,8 @@ void XdgShellClient::init() setDesktop(VirtualDesktopManager::self()->current()); // setup shadow integration - getShadow(); - connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::getShadow); + updateShadow(); + connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::updateShadow); connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWayland::Server::SurfaceInterface *child) { if (child == surface()) { @@ -420,7 +420,7 @@ void XdgShellClient::createDecoration(const QRect &oldGeom) KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this); if (decoration) { QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection); - connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::getShadow); + connect(decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::updateShadow); connect(decoration, &KDecoration2::Decoration::bordersChanged, this, [this]() { GeometryUpdatesBlocker blocker(this); @@ -464,7 +464,7 @@ void XdgShellClient::updateDecoration(bool check_workspace_pos, bool force) m_xdgShellSurface->configure(xdgSurfaceStates(), m_requestedClientSize); } } - getShadow(); + updateShadow(); if (check_workspace_pos) checkWorkspacePosition(oldgeom, -2, oldClientGeom); blockGeometryUpdates(false);