From e04900ecf29fefaa4f679b6aa63d9ea9b57b0f4c Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 11 Dec 2021 19:29:01 +0200 Subject: [PATCH 01/29] position vertical docks/panels more accurately --send more availableRect/Region changed signals for more cases and as such all views update their positioning properly. --for example when a horizontal view updates its offset or max length independent of its visibility mode the neighbour vertical views need to update and validate their position. --- app/view/view.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/app/view/view.cpp b/app/view/view.cpp index a1ca16b2b..2f6b3a740 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -291,6 +291,24 @@ void View::init(Plasma::Containment *plasma_containment) connect(this, &View::activitiesChanged, this, &View::applyActivitiesToWindows); connect(m_positioner, &ViewPart::Positioner::winIdChanged, this, &View::applyActivitiesToWindows); + connect(this, &View::maxLengthChanged, this, [&]() { + if (m_inDelete) { + return; + } + + emit availableScreenRectChangedFrom(this); + emit availableScreenRegionChangedFrom(this); + }); + + connect(this, &View::offsetChanged, this, [&]() { + if (m_inDelete ) { + return; + } + + emit availableScreenRectChangedFrom(this); + emit availableScreenRegionChangedFrom(this); + }); + connect(this, &View::localGeometryChanged, this, [&]() { updateAbsoluteGeometry(); }); @@ -407,6 +425,9 @@ void View::availableScreenRectChangedFromSlot(View *origin) } if (formFactor() == Plasma::Types::Vertical + && origin->formFactor() == Plasma::Types::Horizontal //! accept only horizontal views + && !(origin->location() == Plasma::Types::TopEdge && m_positioner->isStickedOnTopEdge()) //! ignore signals in such case + && !(origin->location() == Plasma::Types::BottomEdge && m_positioner->isStickedOnBottomEdge()) //! ignore signals in such case && origin->layout() && m_layout && origin->layout()->lastUsedActivity() == m_layout->lastUsedActivity()) { @@ -660,8 +681,8 @@ void View::updateAbsoluteGeometry(bool bypassChecks) emit absoluteGeometryChanged(m_absoluteGeometry); } - //! this is needed in order to update correctly the screenGeometries - if (visibility() && corona() && visibility()->mode() == Types::AlwaysVisible) { + if ((m_absoluteGeometry != absGeometry) || bypassChecks) { + //! inform others such as neighbour vertical views that new geometries are applied //! main use of BYPASSCKECKS is from Positioner when the view changes screens emit availableScreenRectChangedFrom(this); emit availableScreenRegionChangedFrom(this); From 0aedefd959b4941347d224a5ddac7f81e726351c Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 11 Dec 2021 19:54:29 +0200 Subject: [PATCH 02/29] canvas ruler:decrease view maxlength properly --whem view minlength and maxlength are equals the Canvas Ruler should decrease and increase both of them when the user mouse scrolls the ruler --- .../configuration/canvas/maxlength/RulerMouseArea.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shell/package/contents/configuration/canvas/maxlength/RulerMouseArea.qml b/shell/package/contents/configuration/canvas/maxlength/RulerMouseArea.qml index 5e03797c6..1e01feb8a 100644 --- a/shell/package/contents/configuration/canvas/maxlength/RulerMouseArea.qml +++ b/shell/package/contents/configuration/canvas/maxlength/RulerMouseArea.qml @@ -34,10 +34,17 @@ MouseArea{ //! replica of updating maximum length from configuration tab function updateMaxLength(step) { + var updateminimumlength = (plasmoid.configuration.maxLength === plasmoid.configuration.minLength); + var tempML = plasmoid.configuration.maxLength + step; - var value = Math.max(Math.min(tempML,100),30); + var value = Math.max(Math.min(tempML,100), 30); + + if (updateminimumlength) { + plasmoid.configuration.minLength = Math.max(30, value); + } + value = Math.max(plasmoid.configuration.minLength, value); plasmoid.configuration.maxLength = value; var newTotal = Math.abs(plasmoid.configuration.offset) + value; From ee2493ba1a1e3722d23d84625686b7cc22c915f9 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 12 Dec 2021 03:29:06 +0200 Subject: [PATCH 03/29] add missing signal --- app/view/view.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/view/view.cpp b/app/view/view.cpp index 2f6b3a740..3b6c9c96f 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -1737,6 +1737,7 @@ void View::restoreConfig() //! Send changed signals at the end in order to be sure that saveConfig //! wont rewrite default/invalid values emit alignmentChanged(); + emit nameChanged(); emit onPrimaryChanged(); emit byPassWMChanged(); } From 50177a8406ada5a52f3d85a985ce03a5d1f92364 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 12 Dec 2021 03:13:35 +0200 Subject: [PATCH 04/29] improve smoothness of animations during startup --This new approach paints all docks and panels during starup offscreen. This way especially under x11 not a lot of visual glitches are appearing all over the place. After startup time has ended docks and panels are moved at their original and valid placement and slide in animations are triggered. --- app/view/positioner.cpp | 29 +++++++++++++- app/view/positioner.h | 6 ++- app/view/view.cpp | 4 -- app/view/view.h | 1 - app/view/visibilitymanager.cpp | 38 +++++++++---------- app/view/visibilitymanager.h | 2 + .../package/contents/ui/VisibilityManager.qml | 20 +++++++++- containment/package/contents/ui/main.qml | 32 +++++++++++++++- 8 files changed, 102 insertions(+), 30 deletions(-) diff --git a/app/view/positioner.cpp b/app/view/positioner.cpp index ad3ccbc65..75dd5681e 100644 --- a/app/view/positioner.cpp +++ b/app/view/positioner.cpp @@ -107,6 +107,7 @@ void Positioner::init() connect(this, &Positioner::hidingForRelocationStarted, this, &Positioner::updateInRelocationAnimation); connect(this, &Positioner::showingAfterRelocationFinished, this, &Positioner::updateInRelocationAnimation); connect(this, &Positioner::showingAfterRelocationFinished, this, &Positioner::syncLatteViews); + connect(this, &Positioner::startupFinished, this, &Positioner::onStartupFinished); connect(m_view, &Latte::View::onPrimaryChanged, this, &Positioner::syncLatteViews); @@ -336,6 +337,14 @@ void Positioner::slideInDuringStartup() m_corona->wm()->slideWindow(*m_view, slideLocation(m_view->containment()->location())); } +void Positioner::onStartupFinished() +{ + if (m_inStartup) { + m_inStartup = false; + syncGeometry(); + } +} + void Positioner::onCurrentLayoutIsSwitching(const QString &layoutName) { if (!m_view || !m_view->layout() || m_view->layout()->name() != layoutName || !m_view->isVisible()) { @@ -509,7 +518,14 @@ void Positioner::immediateSyncGeometry() //! instead of two times (both inside the resizeWindow and the updatePosition) QRegion freeRegion;; QRect maximumRect; - QRect availableScreenRect{m_view->screen()->geometry()}; + QRect availableScreenRect = m_view->screen()->geometry(); + + if (m_inStartup) { + //! paint out-of-screen + availableScreenRect = QRect(-9999, -9999, m_view->screen()->geometry().width(), m_view->screen()->geometry().height()); + } + + qDebug() << " ------------>> " << m_view->location() << " ___ " << availableScreenRect; if (m_view->formFactor() == Plasma::Types::Vertical) { QString layoutName = m_view->layout() ? m_view->layout()->name() : QString(); @@ -538,7 +554,12 @@ void Positioner::immediateSyncGeometry() } QString activityid = m_view->layout() ? m_view->layout()->lastUsedActivity() : QString(); - freeRegion = latteCorona->availableScreenRegionWithCriteria(fixedScreen, activityid, ignoreModes, ignoreEdges); + if (m_inStartup) { + //! paint out-of-screen + freeRegion = availableScreenRect; + } else { + freeRegion = latteCorona->availableScreenRegionWithCriteria(fixedScreen, activityid, ignoreModes, ignoreEdges); + } maximumRect = maximumNormalGeometry(); QRegion availableRegion = freeRegion.intersected(maximumRect); @@ -871,6 +892,10 @@ void Positioner::resizeWindow(QRect availableScreenRect) } } + //! protect from invalid window size under wayland + size.setWidth(qMax(1, size.width())); + size.setHeight(qMax(1, size.height())); + m_validGeometry.setSize(size); m_view->setMinimumSize(size); diff --git a/app/view/positioner.h b/app/view/positioner.h index 481b3afa7..78400efc7 100644 --- a/app/view/positioner.h +++ b/app/view/positioner.h @@ -89,6 +89,7 @@ public: public slots: Q_INVOKABLE void setNextLocation(const QString layoutName, const QString screenId, int edge, int alignment); + Q_INVOKABLE void slideInDuringStartup(); void syncGeometry(); @@ -96,7 +97,6 @@ public slots: //! that might prevent them. It must be called with care. void immediateSyncGeometry(); - void slideInDuringStartup(); void slideOutDuringExit(Plasma::Types::Location location = Plasma::Types::Floating); void initDelayedSignals(); @@ -118,6 +118,8 @@ signals: void hidingForRelocationFinished(); void showingAfterRelocationFinished(); + void startupFinished(); //called from containment qml end of startup sequence + void onHideWindowsForSlidingOut(); void inRelocationAnimationChanged(); void inRelocationShowingChanged(); @@ -129,6 +131,7 @@ private slots: void onScreenChanged(QScreen *screen); void onCurrentLayoutIsSwitching(const QString &layoutName); void onLastRepositionApplyEvent(); + void onStartupFinished(); void validateDockGeometry(); void updateInRelocationAnimation(); @@ -160,6 +163,7 @@ private: bool m_inRelocationAnimation{false}; bool m_inRelocationShowing{false}; bool m_inSlideAnimation{false}; + bool m_inStartup{true}; bool m_isStickedOnTopEdge{false}; bool m_isStickedOnBottomEdge{false}; diff --git a/app/view/view.cpp b/app/view/view.cpp index 3b6c9c96f..178f10864 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -172,10 +172,6 @@ View::View(Plasma::Corona *corona, QScreen *targetScreen, bool byPassX11WM) if (m_positioner) { //! immediateSyncGeometry helps avoiding binding loops from containment qml side m_positioner->immediateSyncGeometry(); - if (m_inStartup) { - m_inStartup = false; - m_positioner->slideInDuringStartup(); - } } connect(this->containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus))); diff --git a/app/view/view.h b/app/view/view.h index 4525a4017..c24488ff7 100644 --- a/app/view/view.h +++ b/app/view/view.h @@ -391,7 +391,6 @@ private: bool m_containsDrag{false}; bool m_containsMouse{false}; bool m_inDelete{false}; - bool m_inStartup{true}; bool m_isPreferredForShortcuts{false}; bool m_onPrimary{true}; bool m_screenEdgeMarginEnabled{false}; diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index a77aede20..d34d88368 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -79,16 +79,6 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view) connect(m_latteView, &Latte::View::inEditModeChanged, this, &VisibilityManager::initViewFlags); - // disabling this call because it was creating too many struts calls and - // could create reduced responsiveness for DynamicStruts Scenario(for example - // when dragging active window from a floating dock/panel) - /* - connect(m_latteView, &Latte::View::absoluteGeometryChanged, this, [&]() { - if (m_mode == Types::AlwaysVisible) { - updateStrutsBasedOnLayoutsAndActivities(); - } - });*/ - //! Frame Extents connect(m_latteView, &Latte::View::headThicknessGapChanged, this, &VisibilityManager::onHeadThicknessChanged); connect(m_latteView, &Latte::View::locationChanged, this, [&]() { @@ -267,23 +257,20 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode) updateStrutsBasedOnLayoutsAndActivities(); } - m_connections[base] = connect(this, &VisibilityManager::strutsThicknessChanged, this, [&]() { - bool execute = !m_timerBlockStrutsUpdate.isActive(); - - m_timerBlockStrutsUpdate.start(); + m_connections[base] = connect(this, &VisibilityManager::strutsThicknessChanged, &VisibilityManager::updateStrutsAfterTimer); - if (execute) { - updateStrutsBasedOnLayoutsAndActivities(); - } - }); + // disabling this call because it was creating too many struts calls and ??? + // could create reduced responsiveness for DynamicStruts Scenario(for example ?? + // when dragging active window from a floating dock/panel) ??? + m_connections[base+1] = connect(m_latteView, &Latte::View::absoluteGeometryChanged, this, &VisibilityManager::updateStrutsAfterTimer); - m_connections[base+1] = connect(m_corona->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged, this, [&]() { + m_connections[base+2] = connect(m_corona->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged, this, [&]() { if (m_corona && m_corona->layoutsManager()->memoryUsage() == MemoryUsage::MultipleLayouts) { updateStrutsBasedOnLayoutsAndActivities(true); } }); - m_connections[base+2] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() { + m_connections[base+3] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() { updateStrutsBasedOnLayoutsAndActivities(true); }); @@ -382,6 +369,17 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode) emit modeChanged(); } +void VisibilityManager::updateStrutsAfterTimer() +{ + bool execute = !m_timerBlockStrutsUpdate.isActive(); + + m_timerBlockStrutsUpdate.start(); + + if (execute) { + updateStrutsBasedOnLayoutsAndActivities(); + } +} + void VisibilityManager::updateSidebarState() { bool cursidebarstate = ((m_mode == Types::SidebarOnDemand) diff --git a/app/view/visibilitymanager.h b/app/view/visibilitymanager.h index 92e240a34..1d9da2a7a 100644 --- a/app/view/visibilitymanager.h +++ b/app/view/visibilitymanager.h @@ -204,6 +204,8 @@ private slots: void dodgeMaximized(); void updateHiddenState(); + void updateStrutsAfterTimer(); + bool isValidMode() const; private: diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 6f1f41826..42b28b04f 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -166,6 +166,11 @@ Item{ } function slotMustBeShown() { + if (root.inStartup) { + slidingAnimationAutoHiddenIn.init(); + return; + } + //! WindowsCanCover case if (latteView && latteView.visibility.mode === LatteCore.Types.WindowsCanCover) { latteView.visibility.setViewOnFrontLayer(); @@ -190,6 +195,11 @@ Item{ } function slotMustBeHide() { + if (root.inStartup) { + slidingAnimationAutoHiddenOut.init(); + return; + } + if (inSlidingIn && !inRelocationHiding) { /*consider hiding after sliding in has finished*/ return; @@ -468,10 +478,18 @@ Item{ latteView.visibility.slideOutFinished(); manager.updateInputGeometry(); + + if (root.inStartup) { + //! when view is first created slide-outs when that animation ends then + //! it flags that startup has ended and first slide-in can be started + //! this is important because if it is removed then some views + //! wont slide-in after startup. + root.inStartup = false; + } } function init() { - if (manager.inRelocationAnimation || !latteView.visibility.blockHiding) { + if (manager.inRelocationAnimation || root.inStartup/*used from recreating views*/ || !latteView.visibility.blockHiding) { start(); } } diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 26775fa77..98238a1c5 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -180,7 +180,7 @@ Item { property bool dragActiveWindowEnabled: plasmoid.configuration.dragActiveWindowEnabled property bool immutable: plasmoid.immutable property bool inFullJustify: (plasmoid.configuration.alignment === LatteCore.Types.Justify) && (maxLengthPerCentage===100) - property bool inStartup: !fastLayoutManager.hasRestoredApplets + property bool inStartup: true property bool isHorizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal property bool isVertical: !isHorizontal @@ -1045,6 +1045,12 @@ Item { onViewChanged: { if (view) { view.interfacesGraphicObj = _interfaces; + + if (!root.inStartup) { + //! used from recreating views + root.inStartup = true; + startupDelayer.start(); + } } } } @@ -1056,10 +1062,34 @@ Item { //! It is used in order to slide-in the latteView on startup onInStartupChanged: { if (!inStartup) { + latteView.positioner.startupFinished(); + latteView.positioner.slideInDuringStartup(); visibilityManager.slotMustBeShown(); } } + Connections { + target:fastLayoutManager + onHasRestoredAppletsChanged: { + if (fastLayoutManager.hasRestoredApplets) { + startupDelayer.start(); + } + } + } + + Timer { + //! Give a little more time to layouter and applets to load and be positioned properly during startup when + //! the view is drawn out-of-screen and afterwards trigger the startup animation sequence: + //! 1.slide-out when out-of-screen //slotMustBeHide() + //! 2.be positioned properly at correct screen //slideInDuringStartup(), triggers Positioner::syncGeometry() + //! 3.slide-in properly in correct screen //slotMustBeShown(); + id: startupDelayer + interval: 1000 + onTriggered: { + visibilityManager.slotMustBeHide(); + } + } + ///////////////END TIMER elements Loader{ From 544b83ebeb15892893da9a205b49d5412684177a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 12 Dec 2021 11:48:21 +0200 Subject: [PATCH 05/29] recreateview:fix launchers group assignment --after recreating a view, launchers group is now assigned again correctly. As it appears the problem was that Host.MyView ability was sending an isReady signal that was not accurate enough. --- app/view/positioner.cpp | 2 -- .../package/contents/ui/abilities/MyView.qml | 15 +++++++-------- declarativeimports/abilities/client/MyView.qml | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/view/positioner.cpp b/app/view/positioner.cpp index 75dd5681e..2f014104f 100644 --- a/app/view/positioner.cpp +++ b/app/view/positioner.cpp @@ -525,8 +525,6 @@ void Positioner::immediateSyncGeometry() availableScreenRect = QRect(-9999, -9999, m_view->screen()->geometry().width(), m_view->screen()->geometry().height()); } - qDebug() << " ------------>> " << m_view->location() << " ___ " << availableScreenRect; - if (m_view->formFactor() == Plasma::Types::Vertical) { QString layoutName = m_view->layout() ? m_view->layout()->name() : QString(); auto latteCorona = qobject_cast(m_view->corona()); diff --git a/containment/package/contents/ui/abilities/MyView.qml b/containment/package/contents/ui/abilities/MyView.qml index d86423607..6a0dc9492 100644 --- a/containment/package/contents/ui/abilities/MyView.qml +++ b/containment/package/contents/ui/abilities/MyView.qml @@ -12,11 +12,10 @@ import "./privates" as Ability Ability.MyViewPrivate { view: latteView - - isReady: latteView + isReady: view && view.visibility && view.layout && view.effects && view.positioner inNormalState: ((animations.needBothAxis.count === 0) && (animations.needLength.count === 0)) - || (view && view.visibility.isHidden && !view.visibility.containsMouse && animations.needThickness.count === 0) + || (isReady && view.visibility.isHidden && !view.visibility.containsMouse && animations.needThickness.count === 0) isHidden: isReady && view.visibility.isHidden isShownPartially: isReady && (inSlidingIn || inSlidingOut) isShownFully: isReady && !isHidden && !inSlidingIn && !inSlidingOut @@ -28,20 +27,20 @@ Ability.MyViewPrivate { inSlidingIn: visibilityManager.inSlidingIn inSlidingOut: visibilityManager.inSlidingOut - inRelocationAnimation: view && view.positioner && view.positioner.inRelocationAnimation + inRelocationAnimation: isReady && view.positioner.inRelocationAnimation inRelocationHiding: visibilityManager.inRelocationHiding badgesIn3DStyle: universalSettings ? universalSettings.badges3DStyle : true alignment: plasmoid.configuration.alignment - visibilityMode: view ? view.visibility.mode : LatteCore.Types.None + visibilityMode: isReady ? view.visibility.mode : LatteCore.Types.None backgroundOpacity: background.currentOpacity - lastUsedActivity: view && view.layout ? view.layout.lastUsedActivity : "" + lastUsedActivity: isReady ? view.layout.lastUsedActivity : "" - appletsLayoutGeometry: view && view.effects ? view.effects.appletsLayoutGeometry : Qt.rect(0, 0, -1, -1) - screenGeometry: view ? view.screenGeometry : plasmoid.screenGeometry + appletsLayoutGeometry: isReady ? view.effects.appletsLayoutGeometry : Qt.rect(0, 0, -1, -1) + screenGeometry: isReady ? view.screenGeometry : plasmoid.screenGeometry containmentActions: isReady ? view.containmentActions : [] diff --git a/declarativeimports/abilities/client/MyView.qml b/declarativeimports/abilities/client/MyView.qml index 6c4384ef4..5d65adae3 100644 --- a/declarativeimports/abilities/client/MyView.qml +++ b/declarativeimports/abilities/client/MyView.qml @@ -55,7 +55,7 @@ AbilityDefinition.MyView { Item { id: ref - readonly property Item myView: bridge ? bridge.myView.host : local + readonly property Item myView: bridge && bridge.myView ? bridge.myView.host : local } //! Bridge - Client assignment From 6ba99f272458158dfed7156576c9aa019d71d046 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 12 Dec 2021 12:52:55 +0200 Subject: [PATCH 06/29] multiple:do not update borderless when no needed --when activating activities under multiple layouts the currentActivityChanged() signal is sent from KActivities before the runningActivitiesChanged() and as such we can end in considering borderless maximized window flag before all appropriate layouts have been enabled. The patch adds a timer and delays borderlessMaximized consideration when currentActivityChanged signal is received. --- app/layouts/synchronizer.cpp | 14 ++++++++++---- app/layouts/synchronizer.h | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index 0eb67621e..7afdeaec8 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -45,16 +45,19 @@ Synchronizer::Synchronizer(QObject *parent) connect(this, &Synchronizer::layoutsChanged, this, &Synchronizer::reloadAssignedLayouts); //! KWin update Disabled Borders - connect(this, &Synchronizer::centralLayoutsChanged, this, &Synchronizer::updateKWinDisabledBorders); + connect(this, &Synchronizer::centralLayoutsChanged, this, &Synchronizer::updateBorderlessMaximizedAfterTimer); connect(m_manager->corona()->universalSettings(), &UniversalSettings::canDisableBordersChanged, this, &Synchronizer::updateKWinDisabledBorders); + m_updateBorderlessMaximized.setInterval(500); + m_updateBorderlessMaximized.setSingleShot(true); + connect(&m_updateBorderlessMaximized, &QTimer::timeout, this, &Synchronizer::updateKWinDisabledBorders); //! KActivities tracking connect(m_manager->corona()->activitiesConsumer(), &KActivities::Consumer::activityRemoved, this, &Synchronizer::onActivityRemoved); connect(m_manager->corona()->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged, - this, &Synchronizer::onCurrentActivityChanged); + this, &Synchronizer::updateBorderlessMaximizedAfterTimer); connect(m_manager->corona()->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged, this, [&]() { @@ -465,10 +468,13 @@ void Synchronizer::onActivityRemoved(const QString &activityid) } } -void Synchronizer::onCurrentActivityChanged(const QString &activityid) +void Synchronizer::updateBorderlessMaximizedAfterTimer() { if (m_manager->memoryUsage() == MemoryUsage::MultipleLayouts) { - updateKWinDisabledBorders(); + //! this signal is also triggered when runningactivities are changed and actually is received first + //! this is why we need a timer here in order to delay that execution and not activate/deactivate + //! maximizedborders faulty because syncMultipleLayoutsToActivities(); has not been executed yet + m_updateBorderlessMaximized.start(); } } diff --git a/app/layouts/synchronizer.h b/app/layouts/synchronizer.h index c832ec69d..4089a563e 100644 --- a/app/layouts/synchronizer.h +++ b/app/layouts/synchronizer.h @@ -128,10 +128,10 @@ signals: private slots: void onActivityRemoved(const QString &activityid); - void onCurrentActivityChanged(const QString &activityid); void onLayoutAdded(const QString &layoutpath); void reloadAssignedLayouts(); + void updateBorderlessMaximizedAfterTimer(); private: void addLayout(CentralLayout *layout); @@ -155,6 +155,8 @@ private: bool m_isLoaded{false}; bool m_isSingleLayoutInDeprecatedRenaming{false}; + QTimer m_updateBorderlessMaximized; + Data::LayoutsTable m_layouts; QList m_centralLayouts; AssignedLayoutsHash m_assignedLayouts; From 80fa1022a57f5cdb41a6d40e1603987034095098 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 12 Dec 2021 14:34:28 +0200 Subject: [PATCH 07/29] multiscreen:disable struts under x11 when overlap --when multiple screens placement have edges that overlap with each other, at that edges struts must be disabled to provide much better windows behavior. For example when dragging a window between such screens and there is an AlwaysVisible panel or dock between them. BUG:445595 FIXED-IN:0.10.5 --- app/screenpool.cpp | 2 + app/screenpool.h | 1 + app/view/visibilitymanager.cpp | 75 ++++++++++++++++++++++++++++++---- app/view/visibilitymanager.h | 4 +- 4 files changed, 74 insertions(+), 8 deletions(-) diff --git a/app/screenpool.cpp b/app/screenpool.cpp index fd235d85d..9ae99225a 100644 --- a/app/screenpool.cpp +++ b/app/screenpool.cpp @@ -129,6 +129,8 @@ void ScreenPool::updateScreenGeometry(const int &screenId, const QRect &screenGe m_screensTable[scrIdStr].geometry = screenGeometry; save(); + + emit screenGeometryChanged(); } diff --git a/app/screenpool.h b/app/screenpool.h index ee25a2bf5..6003f6f32 100644 --- a/app/screenpool.h +++ b/app/screenpool.h @@ -53,6 +53,7 @@ public: signals: void primaryPoolChanged(); + void screenGeometryChanged(); protected: bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index d34d88368..9fb208f14 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -270,7 +270,10 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode) } }); - m_connections[base+3] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() { + //! respect canSetStrut that must be disabled under x11 when an alwaysvisible screen edge is common between two or more screens + m_connections[base+3] = connect(m_corona->screenPool(), &Latte::ScreenPool::screenGeometryChanged, this, &VisibilityManager::updateStrutsAfterTimer); + + m_connections[base+4] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() { updateStrutsBasedOnLayoutsAndActivities(true); }); @@ -397,10 +400,10 @@ void VisibilityManager::updateSidebarState() void VisibilityManager::updateStrutsBasedOnLayoutsAndActivities(bool forceUpdate) { bool inMultipleLayoutsAndCurrent = (m_corona->layoutsManager()->memoryUsage() == MemoryUsage::MultipleLayouts - && m_latteView->layout() && !m_latteView->positioner()->inRelocationAnimation() - && m_latteView->layout()->isCurrent()); + && m_latteView->layout() && !m_latteView->positioner()->inRelocationAnimation() + && m_latteView->layout()->isCurrent()); - if (m_strutsThickness>0 && (m_corona->layoutsManager()->memoryUsage() == MemoryUsage::SingleLayout || inMultipleLayoutsAndCurrent)) { + if (m_strutsThickness>0 && canSetStrut() && (m_corona->layoutsManager()->memoryUsage() == MemoryUsage::SingleLayout || inMultipleLayoutsAndCurrent)) { QRect computedStruts = acceptableStruts(); if (m_publishedStruts != computedStruts || forceUpdate) { //! Force update is needed when very important events happen in DE and there is a chance @@ -417,6 +420,64 @@ void VisibilityManager::updateStrutsBasedOnLayoutsAndActivities(bool forceUpdate } } +bool VisibilityManager::canSetStrut() const +{ + if (!KWindowSystem::isPlatformX11()) { + return true; + } + + // read the wm name, need to do this every time which means a roundtrip unfortunately + // but WM might have changed + //NETRootInfo rootInfo(QX11Info::connection(), NET::Supported | NET::SupportingWMCheck); + //if (qstricmp(rootInfo.wmName(), "KWin") == 0) { + // KWin since 5.7 can handle this fine, so only exclude for other window managers + //return true; + //} + + if (qGuiApp->screens().count() < 2) { + return true; + } + + const QRect thisScreen = m_latteView->screen()->geometry(); + + // Extended struts against a screen edge near to another screen are really harmful, so windows maximized under the panel is a lesser pain + // TODO: force "windows can cover" in those cases? + for (QScreen *screen : qGuiApp->screens()) { + if (!screen || m_latteView->screen() == screen) { + continue; + } + + const QRect otherScreen = screen->geometry(); + + switch (m_latteView->location()) { + case Plasma::Types::TopEdge: + if (otherScreen.bottom() <= thisScreen.top()) { + return false; + } + break; + case Plasma::Types::BottomEdge: + if (otherScreen.top() >= thisScreen.bottom()) { + return false; + } + break; + case Plasma::Types::RightEdge: + if (otherScreen.left() >= thisScreen.right()) { + return false; + } + break; + case Plasma::Types::LeftEdge: + if (otherScreen.right() <= thisScreen.left()) { + return false; + } + break; + default: + return false; + } + } + + return true; +} + QRect VisibilityManager::acceptableStruts() { QRect calcs; @@ -725,9 +786,9 @@ void VisibilityManager::toggleHiddenState() { if (!m_latteView->inEditMode()) { if (isSidebar()) { - // if (m_blockHidingEvents.contains(Q_FUNC_INFO)) { + // if (m_blockHidingEvents.contains(Q_FUNC_INFO)) { // removeBlockHidingEvent(Q_FUNC_INFO); - // } + // } if (m_mode == Latte::Types::SidebarOnDemand) { m_isRequestedShownSidebarOnDemand = !m_isRequestedShownSidebarOnDemand; @@ -741,7 +802,7 @@ void VisibilityManager::toggleHiddenState() } } } else { - /* if (!m_isHidden && !m_blockHidingEvents.contains(Q_FUNC_INFO)) { + /* if (!m_isHidden && !m_blockHidingEvents.contains(Q_FUNC_INFO)) { addBlockHidingEvent(Q_FUNC_INFO); } else if (m_isHidden) { removeBlockHidingEvent(Q_FUNC_INFO); diff --git a/app/view/visibilitymanager.h b/app/view/visibilitymanager.h index 1d9da2a7a..8c640af7c 100644 --- a/app/view/visibilitymanager.h +++ b/app/view/visibilitymanager.h @@ -211,10 +211,12 @@ private slots: private: void startTimerHide(const int &msec = 0); + bool canSetStrut() const; + private: WindowSystem::AbstractWindowInterface *m_wm; Types::Visibility m_mode{Types::None}; - std::array m_connections; + std::array m_connections; QTimer m_timerShow; QTimer m_timerHide; From 4725cd7f2b3d921f1a1043e6829ef9fa02861f1a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 13 Dec 2021 23:01:21 +0200 Subject: [PATCH 08/29] do not allow struts when view is offscreen --- app/view/positioner.cpp | 5 +++++ app/view/positioner.h | 2 ++ app/view/visibilitymanager.cpp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/app/view/positioner.cpp b/app/view/positioner.cpp index 2f014104f..3b0088518 100644 --- a/app/view/positioner.cpp +++ b/app/view/positioner.cpp @@ -266,6 +266,11 @@ void Positioner::setInRelocationShowing(bool active) } } +bool Positioner::isOffScreen() const +{ + return (m_validGeometry.x()<-500 || m_validGeometry.y()<-500); +} + int Positioner::currentScreenId() const { auto *latteCorona = qobject_cast(m_view->corona()); diff --git a/app/view/positioner.h b/app/view/positioner.h index 78400efc7..1b7d36eee 100644 --- a/app/view/positioner.h +++ b/app/view/positioner.h @@ -78,6 +78,8 @@ public: bool isStickedOnBottomEdge() const; void setIsStickedOnBottomEdge(bool sticked); + bool isOffScreen() const; + QRect canvasGeometry(); void setScreenToFollow(QScreen *scr, bool updateScreenId = true); diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 9fb208f14..ae9050a3b 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -422,6 +422,10 @@ void VisibilityManager::updateStrutsBasedOnLayoutsAndActivities(bool forceUpdate bool VisibilityManager::canSetStrut() const { + if (m_latteView->positioner()->isOffScreen()) { + return false; + } + if (!KWindowSystem::isPlatformX11()) { return true; } From 4a9bf2cb7a3e52cca49fd9036affe5b1f1572bd5 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 13 Dec 2021 23:11:05 +0200 Subject: [PATCH 09/29] singlelayout:fix borderless activation/deactivation --- app/layouts/synchronizer.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index 7afdeaec8..61c5d3b05 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -57,7 +57,14 @@ Synchronizer::Synchronizer(QObject *parent) this, &Synchronizer::onActivityRemoved); connect(m_manager->corona()->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged, - this, &Synchronizer::updateBorderlessMaximizedAfterTimer); + this, [&]() { + if (m_manager->memoryUsage() == MemoryUsage::MultipleLayouts) { + //! this signal is also triggered when runningactivities are changed and actually is received first + //! this is why we need a timer here in order to delay that execution and not activate/deactivate + //! maximizedborders faulty because syncMultipleLayoutsToActivities(); has not been executed yet + updateBorderlessMaximizedAfterTimer(); + } + }); connect(m_manager->corona()->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged, this, [&]() { @@ -470,12 +477,10 @@ void Synchronizer::onActivityRemoved(const QString &activityid) void Synchronizer::updateBorderlessMaximizedAfterTimer() { - if (m_manager->memoryUsage() == MemoryUsage::MultipleLayouts) { - //! this signal is also triggered when runningactivities are changed and actually is received first - //! this is why we need a timer here in order to delay that execution and not activate/deactivate - //! maximizedborders faulty because syncMultipleLayoutsToActivities(); has not been executed yet - m_updateBorderlessMaximized.start(); - } + //! this signal is also triggered when runningactivities are changed and actually is received first + //! this is why we need a timer here in order to delay that execution and not activate/deactivate + //! maximizedborders faulty because syncMultipleLayoutsToActivities(); has not been executed yet + m_updateBorderlessMaximized.start(); } void Synchronizer::hideAllViews() @@ -912,7 +917,7 @@ void Synchronizer::syncMultipleLayoutsToActivities() if (!layoutNamesToLoad.contains(layout->name())) { layoutNamesToUnload << layout->name(); } - } + } QString defaultForcedLayout; @@ -951,7 +956,7 @@ void Synchronizer::syncMultipleLayoutsToActivities() "Activating layouts: %2 ...", newlyActivatedLayouts.count(), newlyActivatedLayouts.join(", ")), - 4000, QStringList(Data::Layout::ALLACTIVITIESID)); + 4000, QStringList(Data::Layout::ALLACTIVITIESID)); } //! Unload no needed Layouts From 87efe01a9649d64d065618abd46c2f4586520140 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 13 Dec 2021 23:47:35 +0200 Subject: [PATCH 10/29] view:copy properly screen edge margin Consider -1 as screen edge margin default value and not zero. This way when duplicating a default dock AllBorders are not enabled in the new dock. BUG:446903 FIXED-IN:0.10.5 --- app/layouts/storage.cpp | 2 +- app/view/view.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/layouts/storage.cpp b/app/layouts/storage.cpp index fbfae91b2..c97006709 100644 --- a/app/layouts/storage.cpp +++ b/app/layouts/storage.cpp @@ -1507,7 +1507,7 @@ Data::View Storage::view(const KConfigGroup &containmentGroup) vdata.isActive = false; vdata.onPrimary = containmentGroup.readEntry("onPrimary", true); vdata.screen = containmentGroup.readEntry("lastScreen", IDNULL); - vdata.screenEdgeMargin = containmentGroup.group("General").readEntry("screenEdgeMargin", (int)0); + vdata.screenEdgeMargin = containmentGroup.group("General").readEntry("screenEdgeMargin", (int)-1); int location = containmentGroup.readEntry("location", (int)Plasma::Types::BottomEdge); vdata.edge = (Plasma::Types::Location)location; diff --git a/app/view/view.cpp b/app/view/view.cpp index 178f10864..cdd63c506 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -1359,7 +1359,8 @@ Latte::Data::View View::data() const vdata.screen = containment()->lastScreen(); } - vdata.screenEdgeMargin = m_screenEdgeMargin; + //!screen edge margin can be more accurate in the config file + vdata.screenEdgeMargin = m_screenEdgeMargin > 0 ? m_screenEdgeMargin : containment()->config().group("General").readEntry("screenEdgeMargin", (int)-1); vdata.edge = location(); vdata.maxLength = m_maxLength * 100; From 4f3fef1fda07097e6c4428bcfea4d92b26b08878 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 14 Dec 2021 17:03:24 +0200 Subject: [PATCH 11/29] enable strtus fro all alternative DEs --- app/view/visibilitymanager.cpp | 2 +- app/wm/abstractwindowinterface.cpp | 5 +++++ app/wm/abstractwindowinterface.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index ae9050a3b..75280eed6 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -426,7 +426,7 @@ bool VisibilityManager::canSetStrut() const return false; } - if (!KWindowSystem::isPlatformX11()) { + if (!KWindowSystem::isPlatformX11() || !m_wm->isKWinRunning()/*alternative de*/) { return true; } diff --git a/app/wm/abstractwindowinterface.cpp b/app/wm/abstractwindowinterface.cpp index 6f830d3f8..8428028eb 100644 --- a/app/wm/abstractwindowinterface.cpp +++ b/app/wm/abstractwindowinterface.cpp @@ -261,6 +261,11 @@ bool AbstractWindowInterface::inCurrentDesktopActivity(const WindowInfoWrap &win } //! KWin Interface +bool AbstractWindowInterface::isKWinRunning() const +{ + return m_isKWinInterfaceAvailable; +} + void AbstractWindowInterface::initKWinInterface() { QDBusInterface kwinIface(KWINSERVICE, "/VirtualDesktopManager", KWINVIRTUALDESKTOPMANAGERNAMESPACE, QDBusConnection::sessionBus()); diff --git a/app/wm/abstractwindowinterface.h b/app/wm/abstractwindowinterface.h index 7758c8cf7..35e7d6ab9 100644 --- a/app/wm/abstractwindowinterface.h +++ b/app/wm/abstractwindowinterface.h @@ -102,6 +102,8 @@ public: virtual WindowId winIdFor(QString appId, QString title) = 0; virtual AppData appDataFor(WindowId wid) = 0; + bool isKWinRunning() const; + bool inCurrentDesktopActivity(const WindowInfoWrap &winfo); bool isShowingDesktop() const; From 6497da4a4d6beede0cd1650d4b9e02efb88d3d24 Mon Sep 17 00:00:00 2001 From: Jonas Latza Date: Tue, 14 Dec 2021 17:35:21 +0000 Subject: [PATCH 12/29] [x11] - fix 30bit color depth that makes dock invisible with broken transparency --- app/plasma/extended/panelbackground.cpp | 104 ++++++++++++------------ 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index 928e52ee6..4b19cb79e 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -125,10 +125,10 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg) //! calculating the mid opacity (this is needed in order to handle Oxygen //! that has different opacity levels in the same center element) for (int row=0; row<2; ++row) { - QRgb *line = (QRgb *)center.scanLine(row); + QRgba64 *line = (QRgba64 *)center.scanLine(row); for (int col=0; col 0) { //! calculate the mask baseLine length for(int c = baseCol; c>=0; --c) { - QRgb *l = (QRgb *)corner.scanLine(baseRow); - QRgb point = line[c]; + QRgba64 *l = (QRgba64 *)corner.scanLine(baseRow); + QRgba64 point = line[c]; if (qAlpha(point) > 0) { baseLineLength ++; @@ -202,8 +202,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int tailLimitR = baseRow; for (int r = baseRow-1; r>=0; --r) { - QRgb *line = (QRgb *)corner.scanLine(r); - QRgb fpoint = line[baseCol]; + QRgba64 *line = (QRgba64 *)corner.scanLine(r); + QRgba64 fpoint = line[baseCol]; if (qAlpha(fpoint) == 0) { //! a line that is not part of the roundness because its first pixel is fully transparent break; @@ -215,8 +215,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int c = qMax(0, corner.width() - baseLineLength); for (int r = baseRow-1; r>=0; --r) { - QRgb *line = (QRgb *)corner.scanLine(r); - QRgb point = line[c]; + QRgba64 *line = (QRgba64 *)corner.scanLine(r); + QRgba64 point = line[c]; if (qAlpha(point) != 255) { tailLimitR = r; @@ -234,11 +234,11 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) } else { //! BOTTOMRIGHT CORNER //! it should be TOPRIGHT corner in that case - QRgb *line = (QRgb *)corner.scanLine(baseRow); - QRgb basePoint = line[baseCol]; + QRgba64 *line = (QRgba64 *)corner.scanLine(baseRow); + QRgba64 basePoint = line[baseCol]; - QRgb *isRoundedLine = (QRgb *)corner.scanLine(corner.height()-1); - QRgb isRoundedPoint = isRoundedLine[corner.width()-1]; + QRgba64 *isRoundedLine = (QRgba64 *)corner.scanLine(corner.height()-1); + QRgba64 isRoundedPoint = isRoundedLine[corner.width()-1]; //! If there is roundness, if that point is not fully transparent then //! there is no roundness @@ -247,8 +247,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) if (qAlpha(basePoint) > 0) { //! calculate the mask baseLine length for(int c = baseCol; c 0) { baseLineLength ++; @@ -265,8 +265,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int tailLimitR = 0; for (int r = baseRow+1; r<=corner.height(); ++r) { - QRgb *line = (QRgb *)corner.scanLine(r); - QRgb fpoint = line[baseCol]; + QRgba64 *line = (QRgba64 *)corner.scanLine(r); + QRgba64 fpoint = line[baseCol]; if (qAlpha(fpoint) == 0) { //! a line that is not part of the roundness because its first pixel is not trasparent break; @@ -278,8 +278,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int c = baseLineLength - 1; for (int r = baseRow+1; r<=corner.height(); ++r) { - QRgb *line = (QRgb *)corner.scanLine(r); - QRgb point = line[c]; + QRgba64 *line = (QRgba64 *)corner.scanLine(r); + QRgba64 point = line[c]; if (qAlpha(point) != 255) { tailLimitR = r; @@ -335,8 +335,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) if (topLeftCorner) { //! TOPLEFT corner - QRgb *line = (QRgb *)corner.scanLine(baseRow); - QRgb basePoint = line[baseCol]; + QRgba64 *line = (QRgba64 *)corner.scanLine(baseRow); + QRgba64 basePoint = line[baseCol]; int baseShadowMaxOpacity = 0; @@ -344,8 +344,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) //! calculate the shadow maxOpacity in the base line //! and number of pixels to reach there for(int c = baseCol; c>=0; --c) { - QRgb *l = (QRgb *)corner.scanLine(baseRow); - QRgb point = line[c]; + QRgba64 *l = (QRgba64 *)corner.scanLine(baseRow); + QRgba64 point = line[c]; if (qAlpha(point) > baseShadowMaxOpacity) { baseShadowMaxOpacity = qAlpha(point); @@ -358,8 +358,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) if (baseLineLength>0) { for (int r = baseRow-1; r>=0; --r) { - QRgb *line = (QRgb *)corner.scanLine(r); - QRgb fpoint = line[baseCol]; + QRgba64 *line = (QRgba64 *)corner.scanLine(r); + QRgba64 fpoint = line[baseCol]; if (qAlpha(fpoint) != 0) { //! a line that is not part of the roundness because its first pixel is not trasparent break; @@ -369,8 +369,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) int rowMaxOpacity = 0; for(int c = baseCol; c>=0; --c) { - QRgb *l = (QRgb *)corner.scanLine(r); - QRgb point = line[c]; + QRgba64 *l = (QRgba64 *)corner.scanLine(r); + QRgba64 point = line[c]; if (qAlpha(point) > rowMaxOpacity) { rowMaxOpacity = qAlpha(point); @@ -379,8 +379,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) } for(int c = baseCol; c>=(baseCol - baseLineLength + 1); --c) { - QRgb *l = (QRgb *)corner.scanLine(r); - QRgb point = line[c]; + QRgba64 *l = (QRgba64 *)corner.scanLine(r); + QRgba64 point = line[c]; if (qAlpha(point) != rowMaxOpacity) { transPixels++; @@ -404,16 +404,16 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) } else { //! BOTTOMRIGHT CORNER //! it should be TOPRIGHT corner in that case - QRgb *line = (QRgb *)corner.scanLine(baseRow); - QRgb basePoint = line[baseCol]; + QRgba64 *line = (QRgba64 *)corner.scanLine(baseRow); + QRgba64 basePoint = line[baseCol]; int baseShadowMaxOpacity = 0; if (qAlpha(basePoint) == 0) { //! calculate the base line transparent pixels for(int c = baseCol; c baseShadowMaxOpacity) { baseShadowMaxOpacity = qAlpha(point); @@ -426,8 +426,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) if (baseLineLength>0) { for (int r = baseRow+1; r<=corner.height(); ++r) { - QRgb *line = (QRgb *)corner.scanLine(r); - QRgb fpoint = line[baseCol]; + QRgba64 *line = (QRgba64 *)corner.scanLine(r); + QRgba64 fpoint = line[baseCol]; if (qAlpha(fpoint) != 0) { //! a line that is not part of the roundness because its first pixel is not trasparent break; @@ -437,8 +437,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) int rowMaxOpacity = 0; for(int c = baseCol; c rowMaxOpacity) { rowMaxOpacity = qAlpha(point); @@ -447,8 +447,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) } for(int c = baseCol; c0; --col) { - QRgb pixelData = line[col]; + QRgba64 pixelData = line[col]; if (qAlpha(pixelData) < minOpacity) { discovCol--; @@ -573,8 +573,8 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) if (horizontal) { for(int y = 0; y 0) { if (firstPixel < 0) { @@ -586,9 +586,9 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) } } } else { - QRgb *line = (QRgb *)border.scanLine(0); + QRgba64 *line = (QRgba64 *)border.scanLine(0); for(int x = 0; x 0) { if (firstPixel < 0) { @@ -609,10 +609,10 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) int maxopacity{0}; for (int r=0; r maxopacity) { maxopacity = qAlpha(pixel); From e0887d437c810ed64c5e03ed201607f81b8ac033 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 14 Dec 2021 19:41:20 +0200 Subject: [PATCH 13/29] tasks:identify vivaldi properly --update PulseAudio qml code inside the latte taskmanager in order to identify properly through pid applications that are playing audio but they use a different parent pid to do so. This is the Vivaldi case that appears as Chromium in pulseaudio streams. BUG:446828 FIXED-IN:0.10.5 --- plasmoid/package/contents/ui/PulseAudio.qml | 24 ++++++++++++++++--- .../package/contents/ui/task/TaskItem.qml | 9 ++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/plasmoid/package/contents/ui/PulseAudio.qml b/plasmoid/package/contents/ui/PulseAudio.qml index b963dea57..914850ec2 100644 --- a/plasmoid/package/contents/ui/PulseAudio.qml +++ b/plasmoid/package/contents/ui/PulseAudio.qml @@ -45,8 +45,7 @@ QtObject { var streams = [] for (var i = 0, length = instantiator.count; i < length; ++i) { var stream = instantiator.objectAt(i); - if (stream[key] === value - || (key==="appName" && stream[key].toLowerCase() === value.toLowerCase())) { + if (stream[key] === value || (key==="appName" && stream[key].toLowerCase() === value.toLowerCase())) { streams.push(stream); } } @@ -58,7 +57,23 @@ QtObject { } function streamsForPid(pid) { - return findStreams("pid", pid); + var streams = findStreams("pid", pid); + + if (streams.length === 0) { + for (var i = 0, length = instantiator.count; i < length; ++i) { + var stream = instantiator.objectAt(i); + + if (stream.parentPid === -1) { + stream.parentPid = backend.parentPid(stream.pid); + } + + if (stream.parentPid === pid) { + streams.push(stream); + } + } + } + + return streams; } // QtObject has no default property, hence adding the Instantiator to one explicitly. @@ -70,10 +85,13 @@ QtObject { delegate: QtObject { readonly property int pid: Client ? Client.properties["application.process.id"] : 0 + // Determined on demand. + property int parentPid: -1 readonly property string appName: Client ? Client.properties["application.name"] : "" readonly property bool muted: Muted // whether there is nothing actually going on on that stream readonly property bool corked: Corked + readonly property int volume: Math.round(pulseVolume / PulseAudio.NormalVolume * 100.0) readonly property int pulseVolume: Volume diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 0ea64b8b4..76a0ff580 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -721,13 +721,8 @@ AbilityItem.BasicItem { // a PID to an audio stream window. Otherwise if you have two instances of // an application, one playing and the other not, it will look up appName // for the non-playing instance and erroneously show an indicator on both. - if (!pa.hasPidMatch(taskItem.appName)) { - var streams_result; - streams_result = pa.streamsForAppName(taskItem.appName); - if (streams_result.length===0 && launcherName !== "") { - streams_result = pa.streamsForAppName(launcherName); - } - streams = streams_result; + if (!pa.hasPidMatch(task.appName)) { + streams = pa.streamsForAppName(task.appName); } } From 3ae27ca49627d93aa3d9b5f35bd8fe3dd41c6340 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 14 Dec 2021 19:51:17 +0200 Subject: [PATCH 14/29] tasks: fix typo --- plasmoid/package/contents/ui/task/TaskItem.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 76a0ff580..694345836 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -721,8 +721,8 @@ AbilityItem.BasicItem { // a PID to an audio stream window. Otherwise if you have two instances of // an application, one playing and the other not, it will look up appName // for the non-playing instance and erroneously show an indicator on both. - if (!pa.hasPidMatch(task.appName)) { - streams = pa.streamsForAppName(task.appName); + if (!pa.hasPidMatch(taskItem.appName)) { + streams = pa.streamsForAppName(taskItem.appName); } } From 74ba0dc63b16066a73aaf689452156c426e9ea76 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 14 Dec 2021 20:01:53 +0200 Subject: [PATCH 15/29] Revert "[x11] - fix 30bit color depth that makes dock invisible with broken transparency" This reverts commit 6497da4a4d6beede0cd1650d4b9e02efb88d3d24. --- app/plasma/extended/panelbackground.cpp | 104 ++++++++++++------------ 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index 4b19cb79e..928e52ee6 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -125,10 +125,10 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg) //! calculating the mid opacity (this is needed in order to handle Oxygen //! that has different opacity levels in the same center element) for (int row=0; row<2; ++row) { - QRgba64 *line = (QRgba64 *)center.scanLine(row); + QRgb *line = (QRgb *)center.scanLine(row); for (int col=0; col 0) { //! calculate the mask baseLine length for(int c = baseCol; c>=0; --c) { - QRgba64 *l = (QRgba64 *)corner.scanLine(baseRow); - QRgba64 point = line[c]; + QRgb *l = (QRgb *)corner.scanLine(baseRow); + QRgb point = line[c]; if (qAlpha(point) > 0) { baseLineLength ++; @@ -202,8 +202,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int tailLimitR = baseRow; for (int r = baseRow-1; r>=0; --r) { - QRgba64 *line = (QRgba64 *)corner.scanLine(r); - QRgba64 fpoint = line[baseCol]; + QRgb *line = (QRgb *)corner.scanLine(r); + QRgb fpoint = line[baseCol]; if (qAlpha(fpoint) == 0) { //! a line that is not part of the roundness because its first pixel is fully transparent break; @@ -215,8 +215,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int c = qMax(0, corner.width() - baseLineLength); for (int r = baseRow-1; r>=0; --r) { - QRgba64 *line = (QRgba64 *)corner.scanLine(r); - QRgba64 point = line[c]; + QRgb *line = (QRgb *)corner.scanLine(r); + QRgb point = line[c]; if (qAlpha(point) != 255) { tailLimitR = r; @@ -234,11 +234,11 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) } else { //! BOTTOMRIGHT CORNER //! it should be TOPRIGHT corner in that case - QRgba64 *line = (QRgba64 *)corner.scanLine(baseRow); - QRgba64 basePoint = line[baseCol]; + QRgb *line = (QRgb *)corner.scanLine(baseRow); + QRgb basePoint = line[baseCol]; - QRgba64 *isRoundedLine = (QRgba64 *)corner.scanLine(corner.height()-1); - QRgba64 isRoundedPoint = isRoundedLine[corner.width()-1]; + QRgb *isRoundedLine = (QRgb *)corner.scanLine(corner.height()-1); + QRgb isRoundedPoint = isRoundedLine[corner.width()-1]; //! If there is roundness, if that point is not fully transparent then //! there is no roundness @@ -247,8 +247,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) if (qAlpha(basePoint) > 0) { //! calculate the mask baseLine length for(int c = baseCol; c 0) { baseLineLength ++; @@ -265,8 +265,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int tailLimitR = 0; for (int r = baseRow+1; r<=corner.height(); ++r) { - QRgba64 *line = (QRgba64 *)corner.scanLine(r); - QRgba64 fpoint = line[baseCol]; + QRgb *line = (QRgb *)corner.scanLine(r); + QRgb fpoint = line[baseCol]; if (qAlpha(fpoint) == 0) { //! a line that is not part of the roundness because its first pixel is not trasparent break; @@ -278,8 +278,8 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) int c = baseLineLength - 1; for (int r = baseRow+1; r<=corner.height(); ++r) { - QRgba64 *line = (QRgba64 *)corner.scanLine(r); - QRgba64 point = line[c]; + QRgb *line = (QRgb *)corner.scanLine(r); + QRgb point = line[c]; if (qAlpha(point) != 255) { tailLimitR = r; @@ -335,8 +335,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) if (topLeftCorner) { //! TOPLEFT corner - QRgba64 *line = (QRgba64 *)corner.scanLine(baseRow); - QRgba64 basePoint = line[baseCol]; + QRgb *line = (QRgb *)corner.scanLine(baseRow); + QRgb basePoint = line[baseCol]; int baseShadowMaxOpacity = 0; @@ -344,8 +344,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) //! calculate the shadow maxOpacity in the base line //! and number of pixels to reach there for(int c = baseCol; c>=0; --c) { - QRgba64 *l = (QRgba64 *)corner.scanLine(baseRow); - QRgba64 point = line[c]; + QRgb *l = (QRgb *)corner.scanLine(baseRow); + QRgb point = line[c]; if (qAlpha(point) > baseShadowMaxOpacity) { baseShadowMaxOpacity = qAlpha(point); @@ -358,8 +358,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) if (baseLineLength>0) { for (int r = baseRow-1; r>=0; --r) { - QRgba64 *line = (QRgba64 *)corner.scanLine(r); - QRgba64 fpoint = line[baseCol]; + QRgb *line = (QRgb *)corner.scanLine(r); + QRgb fpoint = line[baseCol]; if (qAlpha(fpoint) != 0) { //! a line that is not part of the roundness because its first pixel is not trasparent break; @@ -369,8 +369,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) int rowMaxOpacity = 0; for(int c = baseCol; c>=0; --c) { - QRgba64 *l = (QRgba64 *)corner.scanLine(r); - QRgba64 point = line[c]; + QRgb *l = (QRgb *)corner.scanLine(r); + QRgb point = line[c]; if (qAlpha(point) > rowMaxOpacity) { rowMaxOpacity = qAlpha(point); @@ -379,8 +379,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) } for(int c = baseCol; c>=(baseCol - baseLineLength + 1); --c) { - QRgba64 *l = (QRgba64 *)corner.scanLine(r); - QRgba64 point = line[c]; + QRgb *l = (QRgb *)corner.scanLine(r); + QRgb point = line[c]; if (qAlpha(point) != rowMaxOpacity) { transPixels++; @@ -404,16 +404,16 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) } else { //! BOTTOMRIGHT CORNER //! it should be TOPRIGHT corner in that case - QRgba64 *line = (QRgba64 *)corner.scanLine(baseRow); - QRgba64 basePoint = line[baseCol]; + QRgb *line = (QRgb *)corner.scanLine(baseRow); + QRgb basePoint = line[baseCol]; int baseShadowMaxOpacity = 0; if (qAlpha(basePoint) == 0) { //! calculate the base line transparent pixels for(int c = baseCol; c baseShadowMaxOpacity) { baseShadowMaxOpacity = qAlpha(point); @@ -426,8 +426,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) if (baseLineLength>0) { for (int r = baseRow+1; r<=corner.height(); ++r) { - QRgba64 *line = (QRgba64 *)corner.scanLine(r); - QRgba64 fpoint = line[baseCol]; + QRgb *line = (QRgb *)corner.scanLine(r); + QRgb fpoint = line[baseCol]; if (qAlpha(fpoint) != 0) { //! a line that is not part of the roundness because its first pixel is not trasparent break; @@ -437,8 +437,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) int rowMaxOpacity = 0; for(int c = baseCol; c rowMaxOpacity) { rowMaxOpacity = qAlpha(point); @@ -447,8 +447,8 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) } for(int c = baseCol; c0; --col) { - QRgba64 pixelData = line[col]; + QRgb pixelData = line[col]; if (qAlpha(pixelData) < minOpacity) { discovCol--; @@ -573,8 +573,8 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) if (horizontal) { for(int y = 0; y 0) { if (firstPixel < 0) { @@ -586,9 +586,9 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) } } } else { - QRgba64 *line = (QRgba64 *)border.scanLine(0); + QRgb *line = (QRgb *)border.scanLine(0); for(int x = 0; x 0) { if (firstPixel < 0) { @@ -609,10 +609,10 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) int maxopacity{0}; for (int r=0; r maxopacity) { maxopacity = qAlpha(pixel); From 0accfe21b28d04b48964501f8ee26a217bcef6e1 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 14 Dec 2021 20:12:09 +0200 Subject: [PATCH 16/29] fix 30bit color depth that makes dock invisible --previous approach did not work correctly on 24bit systems. The new approach should handle properly all cases. --- app/plasma/extended/panelbackground.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index 928e52ee6..8e13b075b 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -120,6 +120,10 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg) QImage center = svg->image(QSize(CENTERWIDTH, CENTERHEIGHT), element(svg, "center")); + if (center.format() != QImage::Format_ARGB32_Premultiplied) { + center.convertTo(QImage::Format_ARGB32_Premultiplied); + } + float alphasum{0}; //! calculating the mid opacity (this is needed in order to handle Oxygen @@ -163,6 +167,10 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) QString cornerId = (topLeftCorner ? "mask-topleft" : "mask-bottomright"); QImage corner = svg->image(svg->elementSize(cornerId), cornerId); + if (corner.format() != QImage::Format_ARGB32_Premultiplied) { + corner.convertTo(QImage::Format_ARGB32_Premultiplied); + } + int baseRow = (topLeftCorner ? corner.height()-1 : 0); int baseCol = (topLeftCorner ? corner.width()-1 : 0); @@ -327,6 +335,10 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) QString cornerId = (topLeftCorner ? "shadow-topleft" : "shadow-bottomright"); QImage corner = svg->image(svg->elementSize(cornerId), cornerId); + if (corner.format() != QImage::Format_ARGB32_Premultiplied) { + corner.convertTo(QImage::Format_ARGB32_Premultiplied); + } + int baseRow = (topLeftCorner ? corner.height()-1 : 0); int baseCol = (topLeftCorner ? corner.width()-1 : 0); @@ -484,6 +496,10 @@ void PanelBackground::updateRoundnessFallback(Plasma::Svg *svg) QString cornerId = element(svg, (m_location == Plasma::Types::LeftEdge ? "bottomright" : "topleft")); QImage corner = svg->image(svg->elementSize(cornerId), cornerId); + if (corner.format() != QImage::Format_ARGB32_Premultiplied) { + corner.convertTo(QImage::Format_ARGB32_Premultiplied); + } + int discovRow = (m_location == Plasma::Types::LeftEdge ? corner.height()-1 : 0); int discovCol{0}; //int discovCol = (m_location == Plasma::Types::LeftEdge ? corner.width()-1 : 0); @@ -552,6 +568,10 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) QImage border = svg->image(svg->elementSize(borderId), borderId); + if (border.format() != QImage::Format_ARGB32_Premultiplied) { + border.convertTo(QImage::Format_ARGB32_Premultiplied); + } + //! find shadow size through, plasma theme int themeshadowsize{0}; From 88603f6aafc4a6b96092027a09bc83e161b43e80 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 15 Dec 2021 21:25:43 +0200 Subject: [PATCH 17/29] more startup improvements --visibility: simplify and improve code for restoring and saving values --enable visibility mode early on the startup sequence --enable windows tracking after startup phase has ended --windows tracking respect also view geometry changes and not only window changes from the desktop environment --- app/view/visibilitymanager.cpp | 68 ++++++---------------- app/view/visibilitymanager.h | 1 - app/view/windowstracker/windowstracker.cpp | 13 +++-- app/wm/tracker/windowstracker.cpp | 14 +++++ app/wm/tracker/windowstracker.h | 2 + 5 files changed, 44 insertions(+), 54 deletions(-) diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 75280eed6..cb42b824f 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -114,8 +114,6 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view) publishFrameExtents(forceUpdate); } - m_timerStartUp.setInterval(4000); - m_timerStartUp.setSingleShot(true); m_timerShow.setSingleShot(true); m_timerHide.setSingleShot(true); @@ -146,6 +144,14 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view) connect(&m_timerBlockStrutsUpdate, &QTimer::timeout, this, [&]() { updateStrutsBasedOnLayoutsAndActivities(); }); restoreConfig(); + + //! connect save values after they have been restored + connect(this, &VisibilityManager::enableKWinEdgesChanged, this, &VisibilityManager::saveConfig); + connect(this, &VisibilityManager::modeChanged, this, &VisibilityManager::saveConfig); + connect(this, &VisibilityManager::raiseOnDesktopChanged, this, &VisibilityManager::saveConfig); + connect(this, &VisibilityManager::raiseOnActivityChanged, this, &VisibilityManager::saveConfig); + connect(this, &VisibilityManager::timerShowChanged, this, &VisibilityManager::saveConfig); + connect(this, &VisibilityManager::timerHideChanged, this, &VisibilityManager::saveConfig); } VisibilityManager::~VisibilityManager() @@ -209,8 +215,11 @@ void VisibilityManager::setViewOnFrontLayer() void VisibilityManager::setMode(Latte::Types::Visibility mode) { - if (m_mode == mode) + if (m_mode == mode) { return; + } + + qDebug() << "Updating visibility mode to :::: " << mode; Q_ASSERT_X(mode != Types::None, staticMetaObject.className(), "set visibility to Types::None"); @@ -367,8 +376,6 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode) break; } - m_latteView->containment()->config().writeEntry("visibility", static_cast(m_mode)); - emit modeChanged(); } @@ -977,8 +984,9 @@ void VisibilityManager::dodgeAllWindows() void VisibilityManager::saveConfig() { - if (!m_latteView->containment()) + if (!m_latteView->containment()) { return; + } auto config = m_latteView->containment()->config(); @@ -987,58 +995,20 @@ void VisibilityManager::saveConfig() config.writeEntry("timerHide", m_timerHideInterval); config.writeEntry("raiseOnDesktopChange", m_raiseOnDesktopChange); config.writeEntry("raiseOnActivityChange", m_raiseOnActivityChange); + config.writeEntry("visibility", static_cast(m_mode)); - m_latteView->containment()->configNeedsSaving(); } void VisibilityManager::restoreConfig() { - if (!m_latteView || !m_latteView->containment()){ - return; - } - auto config = m_latteView->containment()->config(); - m_timerShow.setInterval(config.readEntry("timerShow", 0)); - m_timerHideInterval = qMax(HIDEMINIMUMINTERVAL, config.readEntry("timerHide", 700)); - emit timerShowChanged(); - emit timerHideChanged(); - - m_enableKWinEdgesFromUser = config.readEntry("enableKWinEdges", true); - emit enableKWinEdgesChanged(); - + setTimerHide(qMax(HIDEMINIMUMINTERVAL, config.readEntry("timerHide", 700))); + setTimerShow(config.readEntry("timerShow", 0)); + setEnableKWinEdges(config.readEntry("enableKWinEdges", true)); setRaiseOnDesktop(config.readEntry("raiseOnDesktopChange", false)); setRaiseOnActivity(config.readEntry("raiseOnActivityChange", false)); - auto storedMode = (Types::Visibility)(m_latteView->containment()->config().readEntry("visibility", (int)(Types::DodgeActive))); - - if (storedMode == Types::AlwaysVisible) { - qDebug() << "Loading visibility mode: Always Visible , on startup..."; - setMode(Types::AlwaysVisible); - } else { - connect(&m_timerStartUp, &QTimer::timeout, this, [&]() { - if (!m_latteView || !m_latteView->containment()) { - return; - } - - Types::Visibility fMode = (Types::Visibility)(m_latteView->containment()->config().readEntry("visibility", (int)(Types::DodgeActive))); - qDebug() << "Loading visibility mode:" << fMode << " on startup..."; - setMode(fMode); - }); - connect(m_latteView->containment(), &Plasma::Containment::userConfiguringChanged - , this, [&](bool configuring) { - if (configuring && m_timerStartUp.isActive()) - m_timerStartUp.start(100); - }); - - m_timerStartUp.start(); - } - - connect(m_latteView->containment(), &Plasma::Containment::userConfiguringChanged - , this, [&](bool configuring) { - if (!configuring) { - saveConfig(); - } - }); + setMode((Types::Visibility)(config.readEntry("visibility", (int)(Types::DodgeActive)))); } bool VisibilityManager::containsMouse() const diff --git a/app/view/visibilitymanager.h b/app/view/visibilitymanager.h index 8c640af7c..3466a07fd 100644 --- a/app/view/visibilitymanager.h +++ b/app/view/visibilitymanager.h @@ -220,7 +220,6 @@ private: QTimer m_timerShow; QTimer m_timerHide; - QTimer m_timerStartUp; QTimer m_timerPublishFrameExtents; //! This timer is very important because it blocks how fast struts are updated. //! By using this timer we help the window manager in order to correspond to new diff --git a/app/view/windowstracker/windowstracker.cpp b/app/view/windowstracker/windowstracker.cpp index ad68d860a..fbdaae070 100644 --- a/app/view/windowstracker/windowstracker.cpp +++ b/app/view/windowstracker/windowstracker.cpp @@ -8,6 +8,7 @@ // local #include "currentscreentracker.h" #include "allscreenstracker.h" +#include "../positioner.h" #include "../view.h" #include "../../lattecorona.h" #include "../../wm/tracker/windowstracker.h" @@ -34,10 +35,14 @@ WindowsTracker::WindowsTracker(Latte::View *parent) } }); - m_wm->windowsTracker()->addView(m_latteView); - - emit allScreensChanged(); - emit currentScreenChanged(); + connect(m_latteView->positioner(), &Positioner::startupFinished, this, [&]() { + //! During startup phase windows tracking is not enabled and does not + //! influence startup sequence at all. At the same time to windows tracking + //! takes place during startup and as such startup time is reduced + m_wm->windowsTracker()->addView(m_latteView); + emit allScreensChanged(); + emit currentScreenChanged(); + }); } WindowsTracker::~WindowsTracker() diff --git a/app/wm/tracker/windowstracker.cpp b/app/wm/tracker/windowstracker.cpp index be06a1b8b..b4c04e275 100644 --- a/app/wm/tracker/windowstracker.cpp +++ b/app/wm/tracker/windowstracker.cpp @@ -41,6 +41,11 @@ Windows::Windows(AbstractWindowInterface *parent) m_updateApplicationDataTimer.setSingleShot(true); connect(&m_updateApplicationDataTimer, &QTimer::timeout, this, &Windows::updateApplicationData); + //! delayed update all hints + m_updateAllHintsTimer.setInterval(300); + m_updateAllHintsTimer.setSingleShot(true); + connect(&m_updateAllHintsTimer, &QTimer::timeout, this, &Windows::updateAllHints); + init(); } @@ -169,6 +174,7 @@ void Windows::addView(Latte::View *view) connect(view, &Latte::View::isTouchingBottomViewAndIsBusyChanged, this, &Windows::updateExtraViewHints); connect(view, &Latte::View::isTouchingTopViewAndIsBusyChanged, this, &Windows::updateExtraViewHints); + connect(view, &Latte::View::absoluteGeometryChanged, this, &Windows::updateAllHintsAfterTimer); updateAllHints(); @@ -821,6 +827,14 @@ void Windows::updateScreenGeometries() } } +void Windows::updateAllHintsAfterTimer() +{ + if (!m_updateAllHintsTimer.isActive()) { + updateAllHints(); + m_updateAllHintsTimer.start(); + } +} + void Windows::updateAllHints() { for (const auto view : m_views.keys()) { diff --git a/app/wm/tracker/windowstracker.h b/app/wm/tracker/windowstracker.h index d1c14295b..f3cf10cf1 100644 --- a/app/wm/tracker/windowstracker.h +++ b/app/wm/tracker/windowstracker.h @@ -127,6 +127,7 @@ private: void cleanupFaultyWindows(); void updateAllHints(); + void updateAllHintsAfterTimer(); //! Views void updateHints(Latte::View *view); @@ -182,6 +183,7 @@ private: QMap m_windows; + QTimer m_updateAllHintsTimer; //! Some applications delay their application name/icon identification //! such as Libreoffice that updates its StartupWMClass after //! its startup From 2a0237ac9687dda2f79a1422046d076446480b23 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 16 Dec 2021 17:09:22 +0200 Subject: [PATCH 18/29] update Changelog to 0.10.5 --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1414efe89..7b1f39a14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ #**CHANGELOG**# +#### Version 0.10.5 +* improve startup behavior and reduce visual glitches whenever a dock or panel is first appearing +* prepare code for Plasma LookNFeel packages +* improve applets dragging behavior when changing their position in a dock or panel +* ignore window states when kwin window manager is showing desktop effect +* reposition vertical docks and panels when surrounding docks and panels are changing their maximum length independent of their visibility mode +* reduce/increase maximum length through canvas ruler even when the minimum length equals the maximum length +* do not update kwin borderless windows behavior when it is not really changed for the current running layouts structure +* copied and duplicated docks or panels should not have AllBorders background enabled with no reason +* ignore maxlength that equals zero for fillLength applets as Qt already doing +* support 10bit systems under x11 and not show only a blurred area in that case +* multiscreen: disable struts under x11 for docks or panels that stand between two or more different screens +* tasks: reassign launchers group properly when a dock or panel view is recreated for any of reasons +* tasks: identify vivaldi audio stream properly and show the audio badge in that case +* cmd: support --add-dock through command line even when application is not already running +* cmd: provide option to print all available templates +* cmd: provide option to enable/disable application autostart + #### Version 0.10.4 * Feature Indicators: extend Indicators API in order for indicators to be able to animate their parent icon including when a task launcher is activated * Feature Indicators: expose more Icon properties to indicators From d0ce28ef7d0197b91506d4be5232f2b0e3f95f3f Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 16 Dec 2021 17:11:53 +0200 Subject: [PATCH 19/29] update to v0.10.5 --- CMakeLists.txt | 2 +- containment/package/metadata.desktop | 2 +- plasmoid/package/metadata.desktop | 2 +- shell/package/metadata.desktop | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca031efbf..01a0b772c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(lattedock) cmake_minimum_required(VERSION 3.0 FATAL_ERROR) set(CMAKE_CXX_STANDARD 14) -set(VERSION 0.10.4) +set(VERSION 0.10.5) set(AUTHOR "Michail Vourlakos, Smith Ar") set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org") set(WEBSITE "https://userbase.kde.org/LatteDock") diff --git a/containment/package/metadata.desktop b/containment/package/metadata.desktop index 9d4088765..887cb2030 100644 --- a/containment/package/metadata.desktop +++ b/containment/package/metadata.desktop @@ -59,7 +59,7 @@ NoDisplay=true X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.containment -X-KDE-PluginInfo-Version=0.10.4 +X-KDE-PluginInfo-Version=0.10.5 X-KDE-PluginInfo-Website=https://userbase.kde.org/LatteDock X-KDE-PluginInfo-Category= X-KDE-PluginInfo-Depends= diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index c8e875197..3ce2c9784 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -68,7 +68,7 @@ X-Plasma-Provides=org.kde.plasma.multitasking X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.plasmoid -X-KDE-PluginInfo-Version=0.10.4 +X-KDE-PluginInfo-Version=0.10.5 X-KDE-PluginInfo-Website=https://userbase.kde.org/LatteDock X-KDE-PluginInfo-Category=Windows and Tasks X-KDE-PluginInfo-License=GPL v2+ diff --git a/shell/package/metadata.desktop b/shell/package/metadata.desktop index 044df5ce3..cf3bc245e 100644 --- a/shell/package/metadata.desktop +++ b/shell/package/metadata.desktop @@ -104,5 +104,5 @@ X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-License=GPLv3+ X-KDE-PluginInfo-Name=org.kde.latte.shell -X-KDE-PluginInfo-Version=0.10.4 +X-KDE-PluginInfo-Version=0.10.5 X-KDE-PluginInfo-Website=https://userbase.kde.org/LatteDock From 14be8a9e7187da606e57175ca17db201f19b20fe Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 11:15:37 +0200 Subject: [PATCH 20/29] find Qt5 minor version --- CMakeLists.txt | 6 ++++++ app/config-latte.h.cmake | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01a0b772c..854ae6190 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,15 @@ if(X11_FOUND AND XCB_XCB_FOUND) set(HAVE_X11 ON) endif() +string(REGEX MATCH "\\.([^]]+)\\." QT5_VERSION_MINOR ${Qt5Gui_VERSION}) +string(REGEX REPLACE "\\." "" QT5_VERSION_MINOR ${QT5_VERSION_MINOR}) + string(REGEX MATCH "\\.([^]]+)\\." KF5_VERSION_MINOR ${KF5_VERSION}) string(REGEX REPLACE "\\." "" KF5_VERSION_MINOR ${KF5_VERSION_MINOR}) +message(STATUS "Qt5 VERSION : ${Qt5Gui_VERSION}") +message(STATUS "Qt5 VERSION MINOR : ${QT5_VERSION_MINOR}") + message(STATUS "KF5 VERSION : ${KF5_VERSION}") message(STATUS "KF5 VERSION MINOR : ${KF5_VERSION_MINOR}") diff --git a/app/config-latte.h.cmake b/app/config-latte.h.cmake index ac2d4da14..48ce667c1 100644 --- a/app/config-latte.h.cmake +++ b/app/config-latte.h.cmake @@ -5,6 +5,8 @@ #cmakedefine KF5_VERSION_MINOR @KF5_VERSION_MINOR@ +#cmakedefine QT5_VERSION_MINOR @QT5_VERSION_MINOR@ + #cmakedefine VERSION "@VERSION@" #cmakedefine WEBSITE "@WEBSITE@" From 67c38b194f812e0b4750e4ace95aaa2ba7c59d97 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 11:20:54 +0200 Subject: [PATCH 21/29] still support Qt5 >= 5.12 BUG:447111 --- app/plasma/extended/panelbackground.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index 8e13b075b..feee907b1 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -6,6 +6,7 @@ #include "panelbackground.h" // local +#include #include "theme.h" // Qt @@ -121,7 +122,11 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg) QImage center = svg->image(QSize(CENTERWIDTH, CENTERHEIGHT), element(svg, "center")); if (center.format() != QImage::Format_ARGB32_Premultiplied) { +#if QT5_VERSION_MINOR >= 13 center.convertTo(QImage::Format_ARGB32_Premultiplied); +#else + center = center.convertToFormat(QImage::Format_ARGB32_Premultiplied); +#endif } float alphasum{0}; @@ -168,7 +173,11 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { +#if QT5_VERSION_MINOR >= 13 corner.convertTo(QImage::Format_ARGB32_Premultiplied); +#else + corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); +#endif } int baseRow = (topLeftCorner ? corner.height()-1 : 0); @@ -336,7 +345,11 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { +#if QT5_VERSION_MINOR >= 13 corner.convertTo(QImage::Format_ARGB32_Premultiplied); +#else + corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); +#endif } int baseRow = (topLeftCorner ? corner.height()-1 : 0); @@ -497,7 +510,11 @@ void PanelBackground::updateRoundnessFallback(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { +#if QT5_VERSION_MINOR >= 13 corner.convertTo(QImage::Format_ARGB32_Premultiplied); +#else + corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); +#endif } int discovRow = (m_location == Plasma::Types::LeftEdge ? corner.height()-1 : 0); @@ -569,7 +586,11 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) QImage border = svg->image(svg->elementSize(borderId), borderId); if (border.format() != QImage::Format_ARGB32_Premultiplied) { +#if QT5_VERSION_MINOR >= 13 border.convertTo(QImage::Format_ARGB32_Premultiplied); +#else + border = border.convertToFormat(QImage::Format_ARGB32_Premultiplied); +#endif } //! find shadow size through, plasma theme From e25988ff93f02f37bbeb6a937aae2630f168f6c1 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 11:52:10 +0200 Subject: [PATCH 22/29] fix broken initialization of windows tracking --some improvements of 0.10.5 broke the windows tracking initialization. This is a fix in order for windows tracking to be enabled/disabled properly per dock/panel during startup phase. --- app/view/windowstracker/windowstracker.cpp | 11 +++-------- app/wm/tracker/trackedgeneralinfo.h | 8 ++++---- containment/package/contents/ui/BindingsExternal.qml | 5 ++++- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/app/view/windowstracker/windowstracker.cpp b/app/view/windowstracker/windowstracker.cpp index fbdaae070..232faf49e 100644 --- a/app/view/windowstracker/windowstracker.cpp +++ b/app/view/windowstracker/windowstracker.cpp @@ -35,14 +35,9 @@ WindowsTracker::WindowsTracker(Latte::View *parent) } }); - connect(m_latteView->positioner(), &Positioner::startupFinished, this, [&]() { - //! During startup phase windows tracking is not enabled and does not - //! influence startup sequence at all. At the same time to windows tracking - //! takes place during startup and as such startup time is reduced - m_wm->windowsTracker()->addView(m_latteView); - emit allScreensChanged(); - emit currentScreenChanged(); - }); + m_wm->windowsTracker()->addView(m_latteView); + emit allScreensChanged(); + emit currentScreenChanged(); } WindowsTracker::~WindowsTracker() diff --git a/app/wm/tracker/trackedgeneralinfo.h b/app/wm/tracker/trackedgeneralinfo.h index fcb467c2e..046db5074 100644 --- a/app/wm/tracker/trackedgeneralinfo.h +++ b/app/wm/tracker/trackedgeneralinfo.h @@ -79,10 +79,10 @@ protected: Tracker::Windows *m_tracker{nullptr}; private: - bool m_enabled; - bool m_activeWindowMaximized; - bool m_existsWindowActive; - bool m_existsWindowMaximized; + bool m_enabled{false}; + bool m_activeWindowMaximized{false}; + bool m_existsWindowActive{false}; + bool m_existsWindowMaximized{false}; bool m_isTrackingCurrentActivity{true}; diff --git a/containment/package/contents/ui/BindingsExternal.qml b/containment/package/contents/ui/BindingsExternal.qml index a55353a4f..bd39b113e 100644 --- a/containment/package/contents/ui/BindingsExternal.qml +++ b/containment/package/contents/ui/BindingsExternal.qml @@ -319,7 +319,10 @@ Item { Binding{ target: latteView && latteView.windowsTracker ? latteView.windowsTracker : null property: "enabled" - when: latteView && latteView.windowsTracker && latteView.visibility + //! During startup phase windows tracking is not enabled and does not + //! influence startup sequence at all. At the same time no windows tracking + //! takes place during startup and as such startup time is reduced + when: latteView && latteView.windowsTracker && latteView.visibility && !root.inStartup value: (latteView && latteView.visibility && !(latteView.visibility.mode === LatteCore.Types.AlwaysVisible /* Visibility */ || latteView.visibility.mode === LatteCore.Types.WindowsGoBelow From 1d2a1a03b0e7f263a5e525e3f48f0170e67ac89c Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 12:00:47 +0200 Subject: [PATCH 23/29] Revert "find Qt5 minor version" This reverts commit 14be8a9e7187da606e57175ca17db201f19b20fe. --- CMakeLists.txt | 6 ------ app/config-latte.h.cmake | 2 -- 2 files changed, 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 854ae6190..01a0b772c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,15 +45,9 @@ if(X11_FOUND AND XCB_XCB_FOUND) set(HAVE_X11 ON) endif() -string(REGEX MATCH "\\.([^]]+)\\." QT5_VERSION_MINOR ${Qt5Gui_VERSION}) -string(REGEX REPLACE "\\." "" QT5_VERSION_MINOR ${QT5_VERSION_MINOR}) - string(REGEX MATCH "\\.([^]]+)\\." KF5_VERSION_MINOR ${KF5_VERSION}) string(REGEX REPLACE "\\." "" KF5_VERSION_MINOR ${KF5_VERSION_MINOR}) -message(STATUS "Qt5 VERSION : ${Qt5Gui_VERSION}") -message(STATUS "Qt5 VERSION MINOR : ${QT5_VERSION_MINOR}") - message(STATUS "KF5 VERSION : ${KF5_VERSION}") message(STATUS "KF5 VERSION MINOR : ${KF5_VERSION_MINOR}") diff --git a/app/config-latte.h.cmake b/app/config-latte.h.cmake index 48ce667c1..ac2d4da14 100644 --- a/app/config-latte.h.cmake +++ b/app/config-latte.h.cmake @@ -5,8 +5,6 @@ #cmakedefine KF5_VERSION_MINOR @KF5_VERSION_MINOR@ -#cmakedefine QT5_VERSION_MINOR @QT5_VERSION_MINOR@ - #cmakedefine VERSION "@VERSION@" #cmakedefine WEBSITE "@WEBSITE@" From 5c9a4e8392f4628032748a5534edad07bd5a764a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 12:04:02 +0200 Subject: [PATCH 24/29] simplify qt5 version check --- app/plasma/extended/panelbackground.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index feee907b1..abadeaa66 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -6,7 +6,6 @@ #include "panelbackground.h" // local -#include #include "theme.h" // Qt @@ -122,7 +121,7 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg) QImage center = svg->image(QSize(CENTERWIDTH, CENTERHEIGHT), element(svg, "center")); if (center.format() != QImage::Format_ARGB32_Premultiplied) { -#if QT5_VERSION_MINOR >= 13 +#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) center.convertTo(QImage::Format_ARGB32_Premultiplied); #else center = center.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -173,7 +172,7 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { -#if QT5_VERSION_MINOR >= 13 +#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) corner.convertTo(QImage::Format_ARGB32_Premultiplied); #else corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -345,7 +344,7 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { -#if QT5_VERSION_MINOR >= 13 +#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) corner.convertTo(QImage::Format_ARGB32_Premultiplied); #else corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -510,7 +509,7 @@ void PanelBackground::updateRoundnessFallback(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { -#if QT5_VERSION_MINOR >= 13 +#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) corner.convertTo(QImage::Format_ARGB32_Premultiplied); #else corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -586,7 +585,7 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) QImage border = svg->image(svg->elementSize(borderId), borderId); if (border.format() != QImage::Format_ARGB32_Premultiplied) { -#if QT5_VERSION_MINOR >= 13 +#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) border.convertTo(QImage::Format_ARGB32_Premultiplied); #else border = border.convertToFormat(QImage::Format_ARGB32_Premultiplied); From dc724dfd8b88c99b4ea814a54c336614cab3a595 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 14:22:17 +0200 Subject: [PATCH 25/29] simplify Qt version even more --- app/plasma/extended/panelbackground.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index abadeaa66..9577c75b5 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -121,7 +121,7 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg) QImage center = svg->image(QSize(CENTERWIDTH, CENTERHEIGHT), element(svg, "center")); if (center.format() != QImage::Format_ARGB32_Premultiplied) { -#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) center.convertTo(QImage::Format_ARGB32_Premultiplied); #else center = center.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -172,7 +172,7 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { -#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) corner.convertTo(QImage::Format_ARGB32_Premultiplied); #else corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -344,7 +344,7 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { -#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) corner.convertTo(QImage::Format_ARGB32_Premultiplied); #else corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -509,7 +509,7 @@ void PanelBackground::updateRoundnessFallback(Plasma::Svg *svg) QImage corner = svg->image(svg->elementSize(cornerId), cornerId); if (corner.format() != QImage::Format_ARGB32_Premultiplied) { -#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) corner.convertTo(QImage::Format_ARGB32_Premultiplied); #else corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -585,7 +585,7 @@ void PanelBackground::updateShadow(Plasma::Svg *svg) QImage border = svg->image(svg->elementSize(borderId), borderId); if (border.format() != QImage::Format_ARGB32_Premultiplied) { -#if QTGUI_VERSION >= QT_VERSION_CHECK(5, 13, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) border.convertTo(QImage::Format_ARGB32_Premultiplied); #else border = border.convertToFormat(QImage::Format_ARGB32_Premultiplied); From c711d690e2d55cf02ff20e5249f3c72d1faf392d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 14:24:53 +0200 Subject: [PATCH 26/29] add missing header --- app/plasma/extended/panelbackground.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/plasma/extended/panelbackground.cpp b/app/plasma/extended/panelbackground.cpp index 9577c75b5..b4c75f706 100644 --- a/app/plasma/extended/panelbackground.cpp +++ b/app/plasma/extended/panelbackground.cpp @@ -11,6 +11,7 @@ // Qt #include #include +#include #define CENTERWIDTH 100 #define CENTERHEIGHT 50 From 1da67e4c26107a0bef2563d8d74be6aa47c04e5d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 18 Dec 2021 10:28:09 +0200 Subject: [PATCH 27/29] update Changelog to 0.10.6 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b1f39a14..3377301e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ #**CHANGELOG**# +#### Version 0.10.6 +* fix build with Qt 5.12 +* initialize windows tracking properly + #### Version 0.10.5 * improve startup behavior and reduce visual glitches whenever a dock or panel is first appearing * prepare code for Plasma LookNFeel packages From 380d62b0b165fef3eb960cdc3146dd91412f6579 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 18 Dec 2021 10:31:07 +0200 Subject: [PATCH 28/29] update version to v0.10.6 --- CMakeLists.txt | 2 +- containment/package/metadata.desktop | 2 +- plasmoid/package/metadata.desktop | 2 +- shell/package/metadata.desktop | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01a0b772c..666292c48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(lattedock) cmake_minimum_required(VERSION 3.0 FATAL_ERROR) set(CMAKE_CXX_STANDARD 14) -set(VERSION 0.10.5) +set(VERSION 0.10.6) set(AUTHOR "Michail Vourlakos, Smith Ar") set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org") set(WEBSITE "https://userbase.kde.org/LatteDock") diff --git a/containment/package/metadata.desktop b/containment/package/metadata.desktop index 887cb2030..d2f0dc286 100644 --- a/containment/package/metadata.desktop +++ b/containment/package/metadata.desktop @@ -59,7 +59,7 @@ NoDisplay=true X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.containment -X-KDE-PluginInfo-Version=0.10.5 +X-KDE-PluginInfo-Version=0.10.6 X-KDE-PluginInfo-Website=https://userbase.kde.org/LatteDock X-KDE-PluginInfo-Category= X-KDE-PluginInfo-Depends= diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index 3ce2c9784..431793a4a 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -68,7 +68,7 @@ X-Plasma-Provides=org.kde.plasma.multitasking X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.plasmoid -X-KDE-PluginInfo-Version=0.10.5 +X-KDE-PluginInfo-Version=0.10.6 X-KDE-PluginInfo-Website=https://userbase.kde.org/LatteDock X-KDE-PluginInfo-Category=Windows and Tasks X-KDE-PluginInfo-License=GPL v2+ diff --git a/shell/package/metadata.desktop b/shell/package/metadata.desktop index cf3bc245e..dcea3e09d 100644 --- a/shell/package/metadata.desktop +++ b/shell/package/metadata.desktop @@ -104,5 +104,5 @@ X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-License=GPLv3+ X-KDE-PluginInfo-Name=org.kde.latte.shell -X-KDE-PluginInfo-Version=0.10.5 +X-KDE-PluginInfo-Version=0.10.6 X-KDE-PluginInfo-Website=https://userbase.kde.org/LatteDock From f7f774aeb15d9a1e76b793ef6f257587335534c5 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 19 Dec 2021 08:17:14 +0100 Subject: [PATCH 29/29] appdata: fix/improve - reference the right desktop file for it with , so the appdata and the desktop file are properly associated - remove stray control chars in --- app/org.kde.latte-dock.appdata.xml.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/org.kde.latte-dock.appdata.xml.cmake b/app/org.kde.latte-dock.appdata.xml.cmake index ec1f8405a..090a124ca 100644 --- a/app/org.kde.latte-dock.appdata.xml.cmake +++ b/app/org.kde.latte-dock.appdata.xml.cmake @@ -210,8 +210,9 @@ latte-dock liblatte2plugin.so + org.kde.latte-dock.desktop -​ + @@ -227,10 +228,10 @@ -​ -​ -​ -​ -​ -​ + + + + + +