From 56b4be6f8eb410591925dc0e57f5ba1ba31d7276 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 28 Aug 2018 18:55:33 +0300 Subject: [PATCH] dont crash plasmoid from too fast mouse events make sure that we delete a valid contextMenu and not a ghost reference. This could occur from two-fingers emulating right-click in wayland. BUG: 397635 FIXED-IN: 0.8.1 (cherry picked from commit afb34a85cf7c30eed343e51ceb1d1f73ba7a65a2) --- plasmoid/package/contents/ui/ContextMenu.qml | 4 +++- plasmoid/package/contents/ui/task/TaskDelegate.qml | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plasmoid/package/contents/ui/ContextMenu.qml b/plasmoid/package/contents/ui/ContextMenu.qml index aaa0d9219..6586ec206 100644 --- a/plasmoid/package/contents/ui/ContextMenu.qml +++ b/plasmoid/package/contents/ui/ContextMenu.qml @@ -66,6 +66,7 @@ PlasmaComponents.ContextMenu { activitiesDesktopsMenu.refresh(); } else if (status == PlasmaComponents.DialogStatus.Closed) { root.startCheckRestoreZoomTimer(100); + root.contextMenu = null; menu.destroy(); backend.ungrabMouse(visualParent); } @@ -83,8 +84,9 @@ PlasmaComponents.ContextMenu { loadDynamicLaunchActions(visualParent.m.LauncherUrlWithoutIcon); // backend.ungrabMouse(visualParent); openRelative(); + windowsPreviewDlg.contextMenu = true; - windowsPreviewDlg.hide(); + windowsPreviewDlg.hide("8.2"); icList.directRender = false; diff --git a/plasmoid/package/contents/ui/task/TaskDelegate.qml b/plasmoid/package/contents/ui/task/TaskDelegate.qml index 8b55e1510..3f0040028 100644 --- a/plasmoid/package/contents/ui/task/TaskDelegate.qml +++ b/plasmoid/package/contents/ui/task/TaskDelegate.qml @@ -1145,7 +1145,11 @@ MouseArea{ contextMenu = root.createContextMenu(mainItemContainer, modelIndex(), args); contextMenu.show(); } else { - root.contextMenu.close(); + //! make sure that context menu isnt deleted multiple times and creates a crash + //! bug case: 397635 + var cMenu = root.contextMenu; + root.contextMenu = null; + cMenu.destroy(); } }