Changeset View
Changeset View
Standalone View
Standalone View
effects.cpp
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Line(s) | 220 | #endif | |||
---|---|---|---|---|---|
253 | } | 253 | } | ||
254 | for (Unmanaged *u : ws->unmanagedList()) { | 254 | for (Unmanaged *u : ws->unmanagedList()) { | ||
255 | setupUnmanagedConnections(u); | 255 | setupUnmanagedConnections(u); | ||
256 | } | 256 | } | ||
257 | for (InternalClient *client : ws->internalClients()) { | 257 | for (InternalClient *client : ws->internalClients()) { | ||
258 | setupAbstractClientConnections(client); | 258 | setupAbstractClientConnections(client); | ||
259 | } | 259 | } | ||
260 | if (auto w = waylandServer()) { | 260 | if (auto w = waylandServer()) { | ||
261 | connect(w, &WaylandServer::shellClientAdded, this, | 261 | connect(w, &WaylandServer::shellClientAdded, this, [this](AbstractClient *c) { | ||
262 | [this](XdgShellClient *c) { | | |||
263 | if (c->readyForPainting()) | 262 | if (c->readyForPainting()) | ||
264 | slotXdgShellClientShown(c); | 263 | slotWaylandClientShown(c); | ||
265 | else | 264 | else | ||
266 | connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotXdgShellClientShown); | 265 | connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotWaylandClientShown); | ||
267 | } | 266 | }); | ||
268 | ); | | |||
269 | const auto clients = waylandServer()->clients(); | 267 | const auto clients = waylandServer()->clients(); | ||
270 | for (XdgShellClient *c : clients) { | 268 | for (AbstractClient *c : clients) { | ||
271 | if (c->readyForPainting()) { | 269 | if (c->readyForPainting()) { | ||
272 | setupAbstractClientConnections(c); | 270 | setupAbstractClientConnections(c); | ||
273 | } else { | 271 | } else { | ||
274 | connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotXdgShellClientShown); | 272 | connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotWaylandClientShown); | ||
275 | } | 273 | } | ||
276 | } | 274 | } | ||
277 | } | 275 | } | ||
278 | reconfigure(); | 276 | reconfigure(); | ||
279 | } | 277 | } | ||
280 | 278 | | |||
281 | EffectsHandlerImpl::~EffectsHandlerImpl() | 279 | EffectsHandlerImpl::~EffectsHandlerImpl() | ||
282 | { | 280 | { | ||
▲ Show 20 Lines • Show All 290 Lines • ▼ Show 20 Line(s) | |||||
573 | { | 571 | { | ||
574 | Q_ASSERT(qobject_cast<X11Client *>(t)); | 572 | Q_ASSERT(qobject_cast<X11Client *>(t)); | ||
575 | X11Client *c = static_cast<X11Client *>(t); | 573 | X11Client *c = static_cast<X11Client *>(t); | ||
576 | disconnect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotClientShown); | 574 | disconnect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotClientShown); | ||
577 | setupClientConnections(c); | 575 | setupClientConnections(c); | ||
578 | emit windowAdded(c->effectWindow()); | 576 | emit windowAdded(c->effectWindow()); | ||
579 | } | 577 | } | ||
580 | 578 | | |||
581 | void EffectsHandlerImpl::slotXdgShellClientShown(Toplevel *t) | 579 | void EffectsHandlerImpl::slotWaylandClientShown(Toplevel *toplevel) | ||
582 | { | 580 | { | ||
583 | XdgShellClient *c = static_cast<XdgShellClient *>(t); | 581 | AbstractClient *client = static_cast<AbstractClient *>(toplevel); | ||
584 | setupAbstractClientConnections(c); | 582 | setupAbstractClientConnections(client); | ||
585 | emit windowAdded(t->effectWindow()); | 583 | emit windowAdded(toplevel->effectWindow()); | ||
586 | } | 584 | } | ||
587 | 585 | | |||
588 | void EffectsHandlerImpl::slotUnmanagedShown(KWin::Toplevel *t) | 586 | void EffectsHandlerImpl::slotUnmanagedShown(KWin::Toplevel *t) | ||
589 | { // regardless, unmanaged windows are -yet?- not synced anyway | 587 | { // regardless, unmanaged windows are -yet?- not synced anyway | ||
590 | Q_ASSERT(qobject_cast<Unmanaged *>(t)); | 588 | Q_ASSERT(qobject_cast<Unmanaged *>(t)); | ||
591 | Unmanaged *u = static_cast<Unmanaged*>(t); | 589 | Unmanaged *u = static_cast<Unmanaged*>(t); | ||
592 | setupUnmanagedConnections(u); | 590 | setupUnmanagedConnections(u); | ||
593 | emit windowAdded(u->effectWindow()); | 591 | emit windowAdded(u->effectWindow()); | ||
▲ Show 20 Lines • Show All 491 Lines • ▼ Show 20 Line(s) | |||||
1085 | 1083 | | |||
1086 | EffectWindow* EffectsHandlerImpl::findWindow(WId id) const | 1084 | EffectWindow* EffectsHandlerImpl::findWindow(WId id) const | ||
1087 | { | 1085 | { | ||
1088 | if (X11Client *w = Workspace::self()->findClient(Predicate::WindowMatch, id)) | 1086 | if (X11Client *w = Workspace::self()->findClient(Predicate::WindowMatch, id)) | ||
1089 | return w->effectWindow(); | 1087 | return w->effectWindow(); | ||
1090 | if (Unmanaged* w = Workspace::self()->findUnmanaged(id)) | 1088 | if (Unmanaged* w = Workspace::self()->findUnmanaged(id)) | ||
1091 | return w->effectWindow(); | 1089 | return w->effectWindow(); | ||
1092 | if (waylandServer()) { | 1090 | if (waylandServer()) { | ||
1093 | if (XdgShellClient *w = waylandServer()->findClient(id)) { | 1091 | if (AbstractClient *w = waylandServer()->findClient(id)) { | ||
1094 | return w->effectWindow(); | 1092 | return w->effectWindow(); | ||
1095 | } | 1093 | } | ||
1096 | } | 1094 | } | ||
1097 | return nullptr; | 1095 | return nullptr; | ||
1098 | } | 1096 | } | ||
1099 | 1097 | | |||
1100 | EffectWindow* EffectsHandlerImpl::findWindow(KWayland::Server::SurfaceInterface *surf) const | 1098 | EffectWindow* EffectsHandlerImpl::findWindow(KWayland::Server::SurfaceInterface *surf) const | ||
1101 | { | 1099 | { | ||
1102 | if (waylandServer()) { | 1100 | if (waylandServer()) { | ||
1103 | if (XdgShellClient *w = waylandServer()->findClient(surf)) { | 1101 | if (AbstractClient *w = waylandServer()->findClient(surf)) { | ||
1104 | return w->effectWindow(); | 1102 | return w->effectWindow(); | ||
1105 | } | 1103 | } | ||
1106 | } | 1104 | } | ||
1107 | return nullptr; | 1105 | return nullptr; | ||
1108 | } | 1106 | } | ||
1109 | 1107 | | |||
1110 | EffectWindow *EffectsHandlerImpl::findWindow(QWindow *w) const | 1108 | EffectWindow *EffectsHandlerImpl::findWindow(QWindow *w) const | ||
1111 | { | 1109 | { | ||
▲ Show 20 Lines • Show All 1312 Lines • Show Last 20 Lines |