fix #496,crash when changing to Alternative Session

-- a rare crash when changing to Alternative Session
through Tasks context menu
pull/1/head
Michail Vourlakos 8 years ago
parent 9a131444f4
commit 458750aa06

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

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

Loading…
Cancel
Save