From 7149cf55694127c437dfa2fd5ba44137521e3409 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 9 Feb 2019 09:28:10 +0200 Subject: [PATCH] do not make previews show intrusive BUG: 404099 --- plasmoid/package/contents/ui/main.qml | 1 + .../package/contents/ui/task/TaskItem.qml | 70 +++---------------- 2 files changed, 9 insertions(+), 62 deletions(-) diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 9c2a1b698..15b91e6c8 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -540,6 +540,7 @@ Item { function hide(debug){ // console.log("on hide previews event called: "+debug); + showPreviewWinTimer.stop(); if (latteView && signalSent) { //it is used to unblock dock hiding diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index b2ee09dc5..b099c5e4b 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -108,6 +108,7 @@ MouseArea{ property bool inRemoveStage: false property bool inWheelAction: false + property bool isAbleToShowPreview: true property bool isActive: (IsActive === true) ? true : false property bool isDemandingAttention: (IsDemandingAttention === true) ? true : false property bool isDragged: false @@ -587,7 +588,7 @@ MouseArea{ } //! show previews if enabled - if(root.showPreviews && !windowsPreviewDlg.visible && windowsPreviewDlg.activeItem !== taskItem){ + if(isAbleToShowPreview && ((root.showPreviews && windowsPreviewDlg.activeItem !== taskItem) || root.highlightWindows)){ if (hoveredTimerObj) { //! don't delay showing preview in normal states, //! that is when the dock wasn't hidden @@ -604,30 +605,12 @@ MouseArea{ if (root.latteView && root.latteView.isHalfShown) { return; } - - /* if((!inAnimation)&&(root.dragSource == null)&&(!root.taskInAnimation) && hoverEnabled){ - if (inAttentionAnimation) { - var subSpacerScale = (root.zoomFactor-1)/2; - hiddenSpacerLeft.nScale = subSpacerScale; - hiddenSpacerRight.nScale = subSpacerScale; - } - - if (!inBlockingAnimation || inAttentionAnimation) { - if (icList.orientation == Qt.Horizontal){ - icList.currentSpot = mouseX; - wrapper.calculateScales(mouseX); - } - else{ - icList.currentSpot = mouseY; - wrapper.calculateScales(mouseY); - } - } - }*/ } // IMPORTANT: This must be improved ! even for small milliseconds it reduces performance onExited: { - taskItem.scalesUpdatedOnce = false; + scalesUpdatedOnce = false; + isAbleToShowPreview = true; if (root.latteView && (!root.showPreviews || (root.showPreviews && isLauncher))){ root.latteView.hideTooltipLabel(); @@ -728,33 +711,10 @@ MouseArea{ } onContainsMouseChanged:{ - if(!containsMouse){ - // hiddenSpacerLeft.nScale = 0; - // hiddenSpacerRight.nScale = 0; - - if(!inAnimation) + if(!containsMouse && !inAnimation) { pressed=false; } - ////window previews///////// - if (isWindow) { - if(containsMouse && (root.showPreviews || (!root.showPreviews && root.highlightWindows)) && Latte.WindowSystem.compositingActive){ - if (hoveredTimerObj) { - hoveredTimerObj.restart(); - } else { - if (!root.disableAllWindowsFunctionality) { - hoveredTimerObj = hoveredTimerComponent.createObject(taskItem); - } - } - } - else{ - if (hoveredTimerObj){ - hoveredTimerObj.stop(); - hoveredTimerObj.destroy(); - } - } - } - ////disable hover effect/// if (isWindow && root.highlightWindows && !containsMouse) { root.windowsHovered( root.plasma515 ? model.WinIdList : model.LegacyWinIdList , false); @@ -765,6 +725,7 @@ MouseArea{ //console.log("Pressed Task Delegate.."); if (Latte.WindowSystem.compositingActive && !Latte.WindowSystem.isPlatformWayland) { if(root.leftClickAction !== Latte.Types.PreviewWindows) { + isAbleToShowPreview = false; windowsPreviewDlg.hide(2); } } @@ -788,14 +749,6 @@ MouseArea{ } else { showContextMenu(); } - - //root.createContextMenu(taskItem).show(); - } - - if (hoveredTimerObj){ - hoveredTimerObj.restart(); - /*hoveredTimerObj.stop(); - hoveredTimerObj.destroy();*/ } } @@ -988,13 +941,6 @@ MouseArea{ if (model.IsGroupParent) { if (Latte.WindowSystem.compositingActive && backend.canPresentWindows()) { root.presentWindows(root.plasma515 ? model.WinIdList: model.LegacyWinIdList ); - } else { - if ((windowsPreviewDlg.visualParent === previewsVisualParent)&&(windowsPreviewDlg.visible)) { - windowsPreviewDlg.hide(3); - } else { - preparePreviewWindow(false); - windowsPreviewDlg.show(taskItem); - } } } else { if (IsMinimized === true) { @@ -1022,7 +968,7 @@ MouseArea{ } function showPreviewWindow() { - if (root.disableAllWindowsFunctionality) { + if (root.disableAllWindowsFunctionality || !isAbleToShowPreview) { return; } @@ -1472,7 +1418,7 @@ MouseArea{ repeat: false onTriggered: { - if (root.disableAllWindowsFunctionality) { + if (root.disableAllWindowsFunctionality || !isAbleToShowPreview) { return; }