From ff2b895fed4d7ca36d4ae11b4fea66391dab32bf Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 26 Jun 2018 22:48:43 +0300 Subject: [PATCH] fix launch feedback for plasma 5.13 --in plasma 5.13 there are cases the libtaskmanager shows two launchers because we delay the launcher removal for the bouncing animation. A way to fix this by the user is to disable all startups through plasma systemsettings->launch feedback for the taskmanager. But because this is a default plasma option many users would feel uncomfortable when the launching animation breaks. Such apps were gimp and inkscape. This patch handles that case in order to provide a nice no-breaking launcher animation for these apps also. --- .../package/contents/ui/task/TaskDelegate.qml | 11 ++++++----- .../task/animations/TaskShowWindowAnimation.qml | 16 +++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/plasmoid/package/contents/ui/task/TaskDelegate.qml b/plasmoid/package/contents/ui/task/TaskDelegate.qml index 502d6fe77..b4b9d87f7 100644 --- a/plasmoid/package/contents/ui/task/TaskDelegate.qml +++ b/plasmoid/package/contents/ui/task/TaskDelegate.qml @@ -1200,7 +1200,7 @@ MouseArea{ } function slotWaitingLauncherRemoved(launch) { - if ((isWindow || isStartup) && !visible && launch === launcherUrl) { + if ((isWindow || isStartup || isLauncher) && !visible && launch === launcherUrl) { wrapper.mScale = 1; visible = true; } @@ -1354,15 +1354,16 @@ MouseArea{ root.mimicEnterForParabolic.connect(slotMimicEnterForParabolic); root.launchersUpdatedFor.connect(slotLaunchersChangedFor); + var hasShownLauncher = ((tasksModel.launcherPosition(mainItemContainer.launcherUrl) !== -1) + || (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) !== -1) ); + //startup without launcher - var hideStartup = ((((tasksModel.launcherPosition(mainItemContainer.launcherUrl) == -1) - && (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) == -1) ) - || !launcherIsPresent(mainItemContainer.launcherUrl)) + var hideStartup = ((!hasShownLauncher || !launcherIsPresent(mainItemContainer.launcherUrl)) && mainItemContainer.isStartup); if (!Latte.WindowSystem.compositingActive) { visible = true; - } else if ( (isWindow || isStartup) && root.waitingLauncherExists(launcherUrl)) { + } else if ( (isWindow || isStartup || isLauncher) && root.waitingLauncherExists(launcherUrl)) { root.waitingLauncherRemoved.connect(slotWaitingLauncherRemoved); visible = false; } else if (hideStartup){ diff --git a/plasmoid/package/contents/ui/task/animations/TaskShowWindowAnimation.qml b/plasmoid/package/contents/ui/task/animations/TaskShowWindowAnimation.qml index a54a570fa..3c6b01ec6 100644 --- a/plasmoid/package/contents/ui/task/animations/TaskShowWindowAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/TaskShowWindowAnimation.qml @@ -111,11 +111,14 @@ SequentialAnimation{ } } + var hasShownLauncher = ((tasksModel.launcherPosition(mainItemContainer.launcherUrl) !== -1) + || (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) !== -1) ); + + var launcherIsAlreadyShown = hasShownLauncher && isLauncher && !root.inActivityChange; + //Animation Add/Remove (2) - when is window with no launcher, animations enabled //Animation Add/Remove (3) - when is launcher with no window, animations enabled - var animation2 = ((((tasksModel.launcherPosition(mainItemContainer.launcherUrl) == -1) - && (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) == -1) ) - || !launcherIsPresent(mainItemContainer.launcherUrl)) + var animation2 = ((!hasShownLauncher || !launcherIsPresent(mainItemContainer.launcherUrl)) && mainItemContainer.isWindow && Latte.WindowSystem.compositingActive); @@ -131,9 +134,7 @@ SequentialAnimation{ //startup without launcher, animation should be blocked - var launcherExists = !(((tasksModel.launcherPosition(mainItemContainer.launcherUrl) == -1) - && (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) == -1) ) - || !launcherIsPresent(mainItemContainer.launcherUrl)); + var launcherExists = !(!hasShownLauncher || !launcherIsPresent(mainItemContainer.launcherUrl)); //var hideStartup = launcherExists && mainItemContainer.isStartup; //! fix #976 var hideWindow = root.showWindowsOnlyFromLaunchers && !launcherExists && mainItemContainer.isWindow; @@ -159,7 +160,8 @@ SequentialAnimation{ wrapper.mScale = 1; wrapper.opacity = 1; mainItemContainer.inAnimation = false; - } else if (( animation2 || animation3 || animation6 || isForcedHidden) && (root.durationTime !== 0)){ + } else if (( animation2 || animation3 || animation6 || isForcedHidden) + && (root.durationTime !== 0) && !launcherIsAlreadyShown){ isForcedHidden = false; mainItemContainer.visible = true; wrapper.tempScaleWidth = 0;