1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-28 18:50:40 +03:00

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)
This commit is contained in:
Michail Vourlakos 2018-08-28 18:55:33 +03:00
parent 60f488f3a1
commit 56b4be6f8e
2 changed files with 8 additions and 2 deletions

View File

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

View File

@ -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();
}
}