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
This commit is contained in:
parent
c1eafcbce1
commit
99d3185949
9 changed files with 22 additions and 22 deletions
|
@ -350,25 +350,25 @@ void Compositor::startupWithWorkspace()
|
||||||
|
|
||||||
for (X11Client *c : Workspace::self()->clientList()) {
|
for (X11Client *c : Workspace::self()->clientList()) {
|
||||||
c->setupCompositing();
|
c->setupCompositing();
|
||||||
c->getShadow();
|
c->updateShadow();
|
||||||
}
|
}
|
||||||
for (X11Client *c : Workspace::self()->desktopList()) {
|
for (X11Client *c : Workspace::self()->desktopList()) {
|
||||||
c->setupCompositing();
|
c->setupCompositing();
|
||||||
}
|
}
|
||||||
for (Unmanaged *c : Workspace::self()->unmanagedList()) {
|
for (Unmanaged *c : Workspace::self()->unmanagedList()) {
|
||||||
c->setupCompositing();
|
c->setupCompositing();
|
||||||
c->getShadow();
|
c->updateShadow();
|
||||||
}
|
}
|
||||||
for (InternalClient *client : workspace()->internalClients()) {
|
for (InternalClient *client : workspace()->internalClients()) {
|
||||||
client->setupCompositing();
|
client->setupCompositing();
|
||||||
client->getShadow();
|
client->updateShadow();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto *server = waylandServer()) {
|
if (auto *server = waylandServer()) {
|
||||||
const auto clients = server->clients();
|
const auto clients = server->clients();
|
||||||
for (XdgShellClient *c : clients) {
|
for (XdgShellClient *c : clients) {
|
||||||
c->setupCompositing();
|
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)
|
if (e->atom == atoms->wm_client_leader)
|
||||||
getWmClientLeader();
|
getWmClientLeader();
|
||||||
else if (e->atom == atoms->kde_net_wm_shadow)
|
else if (e->atom == atoms->kde_net_wm_shadow)
|
||||||
getShadow();
|
updateShadow();
|
||||||
else if (e->atom == atoms->kde_skip_close_animation)
|
else if (e->atom == atoms->kde_skip_close_animation)
|
||||||
getSkipCloseAnimation();
|
getSkipCloseAnimation();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -431,7 +431,7 @@ void InternalClient::updateDecoration(bool check_workspace_pos, bool force)
|
||||||
destroyDecoration();
|
destroyDecoration();
|
||||||
}
|
}
|
||||||
|
|
||||||
getShadow();
|
updateShadow();
|
||||||
|
|
||||||
if (check_workspace_pos) {
|
if (check_workspace_pos) {
|
||||||
checkWorkspacePosition(oldFrameGeometry, -2, oldClientGeometry);
|
checkWorkspacePosition(oldFrameGeometry, -2, oldClientGeometry);
|
||||||
|
@ -587,7 +587,7 @@ void InternalClient::createDecoration(const QRect &rect)
|
||||||
KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this);
|
KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this);
|
||||||
if (decoration) {
|
if (decoration) {
|
||||||
QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection);
|
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,
|
connect(decoration, &KDecoration2::Decoration::bordersChanged, this,
|
||||||
[this]() {
|
[this]() {
|
||||||
GeometryUpdatesBlocker blocker(this);
|
GeometryUpdatesBlocker blocker(this);
|
||||||
|
|
|
@ -407,7 +407,7 @@ void Scene::addToplevel(Toplevel *c)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
c->effectWindow()->setSceneWindow(w);
|
c->effectWindow()->setSceneWindow(w);
|
||||||
c->getShadow();
|
c->updateShadow();
|
||||||
w->updateShadow(c->shadow());
|
w->updateShadow(c->shadow());
|
||||||
connect(c, &Toplevel::shadowChanged, this,
|
connect(c, &Toplevel::shadowChanged, this,
|
||||||
[w] {
|
[w] {
|
||||||
|
|
12
shadow.cpp
12
shadow.cpp
|
@ -186,18 +186,18 @@ bool Shadow::init(KDecoration2::Decoration *decoration)
|
||||||
{
|
{
|
||||||
if (m_decorationShadow) {
|
if (m_decorationShadow) {
|
||||||
// disconnect previous connections
|
// disconnect previous connections
|
||||||
disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, 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::getShadow);
|
disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::updateShadow);
|
||||||
disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::getShadow);
|
disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::updateShadow);
|
||||||
}
|
}
|
||||||
m_decorationShadow = decoration->shadow();
|
m_decorationShadow = decoration->shadow();
|
||||||
if (!m_decorationShadow) {
|
if (!m_decorationShadow) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// setup connections - all just mapped to recreate
|
// setup connections - all just mapped to recreate
|
||||||
connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, 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::getShadow);
|
connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::updateShadow);
|
||||||
connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::getShadow);
|
connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::updateShadow);
|
||||||
|
|
||||||
const QMargins &p = m_decorationShadow->padding();
|
const QMargins &p = m_decorationShadow->padding();
|
||||||
m_topOffset = p.top();
|
m_topOffset = p.top();
|
||||||
|
|
|
@ -574,7 +574,7 @@ bool Toplevel::isOnActiveScreen() const
|
||||||
return isOnScreen(screens()->current());
|
return isOnScreen(screens()->current());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Toplevel::getShadow()
|
void Toplevel::updateShadow()
|
||||||
{
|
{
|
||||||
QRect dirtyRect; // old & new shadow region
|
QRect dirtyRect; // old & new shadow region
|
||||||
const QRect oldVisibleRect = visibleRect();
|
const QRect oldVisibleRect = visibleRect();
|
||||||
|
|
|
@ -402,7 +402,7 @@ public:
|
||||||
* Updates the Shadow associated with this Toplevel from X11 Property.
|
* Updates the Shadow associated with this Toplevel from X11 Property.
|
||||||
* Call this method when the Property changes or Compositing is started.
|
* 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
|
* Whether the Toplevel currently wants the shadow to be rendered. Default
|
||||||
* implementation always returns @c true.
|
* implementation always returns @c true.
|
||||||
|
|
|
@ -392,7 +392,7 @@ void X11Client::updateDecoration(bool check_workspace_pos, bool force)
|
||||||
createDecoration(oldgeom);
|
createDecoration(oldgeom);
|
||||||
} else
|
} else
|
||||||
destroyDecoration();
|
destroyDecoration();
|
||||||
getShadow();
|
updateShadow();
|
||||||
if (check_workspace_pos)
|
if (check_workspace_pos)
|
||||||
checkWorkspacePosition(oldgeom, -2, oldClientGeom);
|
checkWorkspacePosition(oldgeom, -2, oldClientGeom);
|
||||||
updateInputWindow();
|
updateInputWindow();
|
||||||
|
@ -405,7 +405,7 @@ void X11Client::createDecoration(const QRect& oldgeom)
|
||||||
KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this);
|
KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this);
|
||||||
if (decoration) {
|
if (decoration) {
|
||||||
QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection);
|
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::resizeOnlyBordersChanged, this, &X11Client::updateInputWindow);
|
||||||
connect(decoration, &KDecoration2::Decoration::bordersChanged, this,
|
connect(decoration, &KDecoration2::Decoration::bordersChanged, this,
|
||||||
[this]() {
|
[this]() {
|
||||||
|
|
|
@ -164,8 +164,8 @@ void XdgShellClient::init()
|
||||||
setDesktop(VirtualDesktopManager::self()->current());
|
setDesktop(VirtualDesktopManager::self()->current());
|
||||||
|
|
||||||
// setup shadow integration
|
// setup shadow integration
|
||||||
getShadow();
|
updateShadow();
|
||||||
connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::getShadow);
|
connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::updateShadow);
|
||||||
|
|
||||||
connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWayland::Server::SurfaceInterface *child) {
|
connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWayland::Server::SurfaceInterface *child) {
|
||||||
if (child == surface()) {
|
if (child == surface()) {
|
||||||
|
@ -420,7 +420,7 @@ void XdgShellClient::createDecoration(const QRect &oldGeom)
|
||||||
KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this);
|
KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this);
|
||||||
if (decoration) {
|
if (decoration) {
|
||||||
QMetaObject::invokeMethod(decoration, "update", Qt::QueuedConnection);
|
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,
|
connect(decoration, &KDecoration2::Decoration::bordersChanged, this,
|
||||||
[this]() {
|
[this]() {
|
||||||
GeometryUpdatesBlocker blocker(this);
|
GeometryUpdatesBlocker blocker(this);
|
||||||
|
@ -464,7 +464,7 @@ void XdgShellClient::updateDecoration(bool check_workspace_pos, bool force)
|
||||||
m_xdgShellSurface->configure(xdgSurfaceStates(), m_requestedClientSize);
|
m_xdgShellSurface->configure(xdgSurfaceStates(), m_requestedClientSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getShadow();
|
updateShadow();
|
||||||
if (check_workspace_pos)
|
if (check_workspace_pos)
|
||||||
checkWorkspacePosition(oldgeom, -2, oldClientGeom);
|
checkWorkspacePosition(oldgeom, -2, oldClientGeom);
|
||||||
blockGeometryUpdates(false);
|
blockGeometryUpdates(false);
|
||||||
|
|
Loading…
Reference in a new issue