From 7f97714e2bc40de511c09b3d7bdb8cb4c94e8eba Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 22 Aug 2018 18:13:39 +0300 Subject: [PATCH] remove deprecated code from old multi-screens arch --Latte will no longer try to be too smart concerning the multi-screens behavior. At the old implementation Latte wouldnt let you reach at a state that you dont have a tasks plasmoid available. Such a case could be when the user moves a dock from primary to explicit screen and disables the screen afterwards. That case should be thought better in the future in order to be identified and handled properly without making the code unnecessary complex. Such an example could be by identifing the case and asking the user for actions. (cherry picked from commit b2f1f98b5729fabdb00512ff0c90ffcbf44c12fd) --- app/dock/dockview.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/app/dock/dockview.cpp b/app/dock/dockview.cpp index dd131038a..6f6cd6137 100644 --- a/app/dock/dockview.cpp +++ b/app/dock/dockview.cpp @@ -490,14 +490,9 @@ void DockView::reconsiderScreen() qDebug() << "dock screen exists ::: " << screenExists; - int docksWithTasks = m_managedLayout ? m_managedLayout->noDocksWithTasks() : 0; - //! 1.a primary dock must be always on the primary screen - //! 2.the last tasks dock must also always on the primary screen - //! even though it has been configured as an explicit - if ((m_onPrimary || (tasksPresent() && docksWithTasks == 1 && !screenExists)) - && (m_screenToFollowId != qGuiApp->primaryScreen()->name() - || m_screenToFollow != qGuiApp->primaryScreen())) { + if (m_onPrimary && (m_screenToFollowId != qGuiApp->primaryScreen()->name() + || m_screenToFollow != qGuiApp->primaryScreen())) { using Plasma::Types; QList edges{Types::BottomEdge, Types::LeftEdge, Types::TopEdge, Types::RightEdge}; @@ -510,25 +505,18 @@ void DockView::reconsiderScreen() qDebug() << "dock location:" << location(); if (edges.contains(location())) { - //! case 2 - if (!m_onPrimary && !screenExists && tasksPresent() && (docksWithTasks == 1)) { - qDebug() << "reached case 2 of updating dock primary screen..."; - setScreenToFollow(qGuiApp->primaryScreen(), false); - } else { - //! case 1 - qDebug() << "reached case 1 of updating dock primary screen..."; - setScreenToFollow(qGuiApp->primaryScreen()); - } - + //! case 1 + qDebug() << "reached case 1: of updating dock primary screen..."; + setScreenToFollow(qGuiApp->primaryScreen()); syncGeometry(); } } else if (!m_onPrimary) { - //! 3.an explicit dock must be always on the correct associated screen + //! 2.an explicit dock must be always on the correct associated screen //! there are cases that window manager misplaces the dock, this function //! ensures that this dock will return at its correct screen foreach (auto scr, qGuiApp->screens()) { if (scr && scr->name() == m_screenToFollowId) { - qDebug() << "updating the explicit screen for dock..."; + qDebug() << "reached case 2: updating the explicit screen for dock..."; setScreenToFollow(scr); syncGeometry(); break;