From ad074a6dabd217186817d7b9d27a0b3aa528b31a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 4 Jan 2020 19:57:54 +0200 Subject: [PATCH] improve View workarounds for kwin activities --improve the new worksarounds in order to always apply the activities that a view and its windows are present when the workarounds were triggered from kwin faulty behavior. The kwin faulty behavior is that when any activity is paused then all Latte::Views become hidden and lose their activities references. The workarounds are timers that when they trace a faulty visible state !visible are restoring the normal behavior to views. --- app/view/view.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/view/view.cpp b/app/view/view.cpp index 4e161be9a..0ac92ec51 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -957,27 +957,29 @@ void View::setLayout(Layout::GenericLayout *layout) } }); - connectionsLayout << connect(&m_visibleHackTimer1, &QTimer::timeout, this, [&]() { + connectionsLayout << connect(&m_visibleHackTimer1, &QTimer::timeout, this, [&]() { + applyActivitiesToWindows(); + emit activitiesChanged(); + if (m_layout && !inDelete() & !isVisible()) { show(); - applyActivitiesToWindows(); //qDebug() << "View:: Enforce reshow from timer 1..."; - emit activitiesChanged(); emit forcedShown(); - } else { + } else { //qDebug() << "View:: No needed reshow from timer 1..."; } }); connectionsLayout << connect(&m_visibleHackTimer2, &QTimer::timeout, this, [&]() { - if (m_layout && !inDelete() && !isVisible()) { + applyActivitiesToWindows(); + emit activitiesChanged(); + + if (m_layout && !inDelete() & !isVisible()) { show(); - applyActivitiesToWindows(); - //qDebug() << "View:: Enforce reshow from timer 2..."; - emit activitiesChanged(); + //qDebug() << "View:: Enforce reshow from timer 1..."; emit forcedShown(); } else { - //qDebug() << "View:: No needed reshow from timer 2..."; + //qDebug() << "View:: No needed reshow from timer 1..."; } });