1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-21 10:50:30 +03:00

fix #496,crash when changing to Alternative Session

-- a rare crash when changing to Alternative Session
through Tasks context menu
This commit is contained in:
Michail Vourlakos 2017-05-27 19:15:49 +03:00
parent 9a131444f4
commit 458750aa06
2 changed files with 23 additions and 1 deletions

View File

@ -862,7 +862,15 @@ PlasmaComponents.ContextMenu {
checked = root.altSessionAction.checked;
}
onClicked: root.altSessionAction.trigger();
onClicked: {
//fix a crash that when going to Alternative Session through Context Menu,
//animations are played during the destruction and because of that Latte.IconItem is crashing
root.disableRestoreZoom = false;
root.clearZoom();
if (latteDock)
latteDock.clearZoom();
changeToAlternativeSessionTimer.start();
}
}
PlasmaComponents.MenuItem {

View File

@ -452,6 +452,20 @@ Item {
onTriggered: windowsPreviewDlg.visible = true;
}
//! Timer to fix a crash that when going to Alternative Session through Context Menu,
//! animations are played during the destruction and because of that Latte.IconItem is crashing.
//! the timer makes sure that the animations will have ended and then change to alternative
//! session
Timer {
id: changeToAlternativeSessionTimer
//this is the animation time needed in order for tasks to restore their zoom first
interval: 7 * (root.durationTime * units.shortDuration)
onTriggered: {
if (root.altSessionAction)
root.altSessionAction.trigger();
}
}
/////Window Previews/////////
TaskManager.TasksModel {