Merge setting up abstractclient and x11client connections in EffectsHandler

Summary: Toplevel::paddingChanged() is not an X11-specific signal.

Test Plan: Relevant tests still pass.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29520
icc-effect-master
Vlad Zahorodnii 2020-05-08 10:07:20 +03:00
parent 44143ef7ae
commit 78180c0348
2 changed files with 7 additions and 14 deletions

View File

@ -181,7 +181,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
); );
connect(ws, &Workspace::internalClientAdded, this, connect(ws, &Workspace::internalClientAdded, this,
[this](InternalClient *client) { [this](InternalClient *client) {
setupAbstractClientConnections(client); setupClientConnections(client);
emit windowAdded(client->effectWindow()); emit windowAdded(client->effectWindow());
} }
); );
@ -255,7 +255,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
setupUnmanagedConnections(u); setupUnmanagedConnections(u);
} }
for (InternalClient *client : ws->internalClients()) { for (InternalClient *client : ws->internalClients()) {
setupAbstractClientConnections(client); setupClientConnections(client);
} }
if (auto w = waylandServer()) { if (auto w = waylandServer()) {
connect(w, &WaylandServer::shellClientAdded, this, [this](AbstractClient *c) { connect(w, &WaylandServer::shellClientAdded, this, [this](AbstractClient *c) {
@ -267,7 +267,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
const auto clients = waylandServer()->clients(); const auto clients = waylandServer()->clients();
for (AbstractClient *c : clients) { for (AbstractClient *c : clients) {
if (c->readyForPainting()) { if (c->readyForPainting()) {
setupAbstractClientConnections(c); setupClientConnections(c);
} else { } else {
connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotWaylandClientShown); connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotWaylandClientShown);
} }
@ -293,7 +293,7 @@ void EffectsHandlerImpl::unloadAllEffects()
effectsChanged(); effectsChanged();
} }
void EffectsHandlerImpl::setupAbstractClientConnections(AbstractClient* c) void EffectsHandlerImpl::setupClientConnections(AbstractClient* c)
{ {
connect(c, &AbstractClient::windowClosed, this, &EffectsHandlerImpl::slotWindowClosed); connect(c, &AbstractClient::windowClosed, this, &EffectsHandlerImpl::slotWindowClosed);
connect(c, static_cast<void (AbstractClient::*)(KWin::AbstractClient*, MaximizeMode)>(&AbstractClient::clientMaximizedStateChanged), connect(c, static_cast<void (AbstractClient::*)(KWin::AbstractClient*, MaximizeMode)>(&AbstractClient::clientMaximizedStateChanged),
@ -334,6 +334,7 @@ void EffectsHandlerImpl::setupAbstractClientConnections(AbstractClient* c)
connect(c, &AbstractClient::geometryShapeChanged, this, &EffectsHandlerImpl::slotGeometryShapeChanged); connect(c, &AbstractClient::geometryShapeChanged, this, &EffectsHandlerImpl::slotGeometryShapeChanged);
connect(c, &AbstractClient::frameGeometryChanged, this, &EffectsHandlerImpl::slotFrameGeometryChanged); connect(c, &AbstractClient::frameGeometryChanged, this, &EffectsHandlerImpl::slotFrameGeometryChanged);
connect(c, &AbstractClient::damaged, this, &EffectsHandlerImpl::slotWindowDamaged); connect(c, &AbstractClient::damaged, this, &EffectsHandlerImpl::slotWindowDamaged);
connect(c, &AbstractClient::paddingChanged, this, &EffectsHandlerImpl::slotPaddingChanged);
connect(c, &AbstractClient::unresponsiveChanged, this, connect(c, &AbstractClient::unresponsiveChanged, this,
[this, c](bool unresponsive) { [this, c](bool unresponsive) {
emit windowUnresponsiveChanged(c->effectWindow(), unresponsive); emit windowUnresponsiveChanged(c->effectWindow(), unresponsive);
@ -368,12 +369,6 @@ void EffectsHandlerImpl::setupAbstractClientConnections(AbstractClient* c)
); );
} }
void EffectsHandlerImpl::setupClientConnections(X11Client *c)
{
setupAbstractClientConnections(c);
connect(c, &X11Client::paddingChanged, this, &EffectsHandlerImpl::slotPaddingChanged);
}
void EffectsHandlerImpl::setupUnmanagedConnections(Unmanaged* u) void EffectsHandlerImpl::setupUnmanagedConnections(Unmanaged* u)
{ {
connect(u, &Unmanaged::windowClosed, this, &EffectsHandlerImpl::slotWindowClosed); connect(u, &Unmanaged::windowClosed, this, &EffectsHandlerImpl::slotWindowClosed);
@ -579,7 +574,7 @@ void EffectsHandlerImpl::slotClientShown(KWin::Toplevel *t)
void EffectsHandlerImpl::slotWaylandClientShown(Toplevel *toplevel) void EffectsHandlerImpl::slotWaylandClientShown(Toplevel *toplevel)
{ {
AbstractClient *client = static_cast<AbstractClient *>(toplevel); AbstractClient *client = static_cast<AbstractClient *>(toplevel);
setupAbstractClientConnections(client); setupClientConnections(client);
emit windowAdded(toplevel->effectWindow()); emit windowAdded(toplevel->effectWindow());
} }

View File

@ -59,7 +59,6 @@ class Group;
class Toplevel; class Toplevel;
class Unmanaged; class Unmanaged;
class WindowPropertyNotifyX11Filter; class WindowPropertyNotifyX11Filter;
class X11Client;
class KWIN_EXPORT EffectsHandlerImpl : public EffectsHandler class KWIN_EXPORT EffectsHandlerImpl : public EffectsHandler
{ {
@ -308,8 +307,7 @@ protected:
void connectNotify(const QMetaMethod &signal) override; void connectNotify(const QMetaMethod &signal) override;
void disconnectNotify(const QMetaMethod &signal) override; void disconnectNotify(const QMetaMethod &signal) override;
void effectsChanged(); void effectsChanged();
void setupAbstractClientConnections(KWin::AbstractClient *c); void setupClientConnections(KWin::AbstractClient *client);
void setupClientConnections(KWin::X11Client *c);
void setupUnmanagedConnections(KWin::Unmanaged *u); void setupUnmanagedConnections(KWin::Unmanaged *u);
/** /**