From b4dd016ed0d861e9c1676cbd6edb425edbe6c966 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 28 Aug 2018 19:35:49 +0300 Subject: [PATCH] delay hiding previews when creating contextmenu -- there are cases that hiding previews too early can create crashes under wayland. Such a case is when the user uses the touchpad to emulate a right-click event to create a context menu for specific task BUG: 397635 FIXED-IN: 0.8.1 --- plasmoid/package/contents/ui/ContextMenu.qml | 9 ++++++--- plasmoid/package/contents/ui/main.qml | 5 ++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plasmoid/package/contents/ui/ContextMenu.qml b/plasmoid/package/contents/ui/ContextMenu.qml index 6586ec206..744d8c858 100644 --- a/plasmoid/package/contents/ui/ContextMenu.qml +++ b/plasmoid/package/contents/ui/ContextMenu.qml @@ -85,8 +85,12 @@ PlasmaComponents.ContextMenu { // backend.ungrabMouse(visualParent); openRelative(); - windowsPreviewDlg.contextMenu = true; - windowsPreviewDlg.hide("8.2"); + if (Latte.WindowSystem.isPlatformWayland){ + //!Hiding previews under wayland it needs a delay otherwise it creates crashes + windowsPreviewCheckerToNotShowTimer.start(); + } else { + windowsPreviewDlg.hide("9.4"); + } icList.directRender = false; @@ -276,7 +280,6 @@ PlasmaComponents.ContextMenu { Component.onDestruction: { if (!changingLayout) { - windowsPreviewDlg.contextMenu = false; root.contextMenu = null; backend.ungrabMouse(visualParent); root.signalActionsBlockHiding(-1); diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 3e7a0f265..9057e9314 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -483,7 +483,6 @@ Item { mainItem: toolTipDelegate visible: false - property bool contextMenu: false property bool signalSent: false property Item activeItem: null @@ -505,7 +504,7 @@ Item { windowsPreviewDlg.activeItem = null; - if (!contextMenu) + if (!root.contextMenu) root.disableRestoreZoom = false; visible = false; @@ -572,7 +571,7 @@ Item { onTriggered: { if (windowsPreviewDlg.visible && root.contextMenu) { - windowsPreviewDlg.hide(); + windowsPreviewDlg.hide("8.2"); } } }