hein updated this revision to Diff 9744. hein added a comment.
Eliminate reliance on QueuedConnection. In the previous version of the patch we still relied on QueuedConnection for the dataChanged invocation, because we were connecting to our own rowsRemoved. Proxy models emit rowsRemoved in response to their source model emitting aboutToBeRemoved (a row has to be removed from a proxy before it is removed from the source, otherwise things dangle). The dataChanged causes filterAcceptsRow to run, which checks the filterProxyModel for window/startup rows. With a direct connection it would still have the window, since it's just in "about to remove" stage, necessitating the QueuedConnection. Queueing things is Bad because it's hard to be sure what happens while the event loop spins. In this version of the patch we collect the indices in the source model's aboutToBeRemoved as previously, but then invoke dataChanged as the filterProxyModel (the one filterAcceptsRow checks) emits rowsRemoved. Now we can be sure filterAcceptsRow won't find the window in the filterProxyModel and will let the 'changed' launcher through, completing the lifecycle transition. This guarantees things happen synchronously without an event loop spin inbetween, which should also take care of the activity thing. REPOSITORY R120 Plasma Workspace CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D3950?vs=9692&id=9744 BRANCH master REVISION DETAIL https://phabricator.kde.org/D3950 AFFECTED FILES libtaskmanager/tasksmodel.cpp EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: hein, davidedmundson, mart Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas