From 55f169d1c34491f0d97c8b7a162f4ba60f6849e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 17 Mar 2017 16:32:34 +0100 Subject: [PATCH] fix occassional crash caused by needlessly delayed signals (bko#363224) As pointed out by the Valgrind trace in #363224, delaying the signal causes the EffectWindow* argument to become invalid before the connected slot is called (this is because Qt discards only delayed signal->slot calls where the receiver gets deleted meanwhile, not the sender and definitely not a random argument. If the supposed glitches really happen, they should get fixed correctly, and for all cases (I doubt only desktop number would be involved but not e.g. shaded or minimized states). https://phabricator.kde.org/D5164 CCBUG: 363224 --- effects.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/effects.cpp b/effects.cpp index e6e636c99c..ec9f5016cf 100644 --- a/effects.cpp +++ b/effects.cpp @@ -141,11 +141,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) if (!c->effectWindow()) { return; } - // the visibility update hasn't happed yet, thus the signal is delayed to prevent glitches, see also BUG 347490 - QMetaObject::invokeMethod(this, "desktopPresenceChanged", Qt::QueuedConnection, - Q_ARG(KWin::EffectWindow*, c->effectWindow()), - Q_ARG(int, old), - Q_ARG(int, c->desktop())); + emit desktopPresenceChanged(c->effectWindow(), old, c->desktop()); } ); connect(ws, &Workspace::clientAdded, this,