1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-18 02:04:32 +03:00

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.
This commit is contained in:
Michail Vourlakos 2018-06-26 22:48:43 +03:00
parent bc93683d25
commit ff2b895fed
2 changed files with 15 additions and 12 deletions

View File

@ -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){

View File

@ -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;