Commit 99d31859 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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
parent c1eafcbc
......@@ -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();
}
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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] {
......
......@@ -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();
......
......@@ -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();
......
......@@ -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.
......
......@@ -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]() {
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment