From b0702cf2f2824dab43f7847e0a60246846e13fd1 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Fri, 8 Aug 2025 23:13:41 +0200 Subject: [PATCH] Fix applauncher clipboard copy --- Bar/Modules/Applauncher.qml | 43 ++++++++++++------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/Bar/Modules/Applauncher.qml b/Bar/Modules/Applauncher.qml index e3f15c9..cf8bdc0 100644 --- a/Bar/Modules/Applauncher.qml +++ b/Bar/Modules/Applauncher.qml @@ -68,14 +68,9 @@ PanelWithOverlay { }; - const exists = clipboardHistory.find(item => - item.type === 'image' && item.data === entry.data - ); - - if (!exists) { - clipboardHistory = [entry, ...clipboardHistory].slice(0, 20); - root.updateFilter(); - } + // Always create a new image entry, even if identical to an existing one + clipboardHistory = [entry].concat(clipboardHistory).slice(0, 20); + root.updateFilter(); } } @@ -103,29 +98,19 @@ PanelWithOverlay { }; - const exists = clipboardHistory.find(item => { - if (item.type === 'text') { - return item.content === content; + var newHistory = clipboardHistory.map(item => { + if (typeof item === 'string') { + return { + type: 'text', + content: item, + timestamp: 0 + }; } - - return item === content; + return item; }); - if (!exists) { - - const newHistory = clipboardHistory.map(item => { - if (typeof item === 'string') { - return { - type: 'text', - content: item, - timestamp: new Date().getTime() - }; - } - return item; - }); - - clipboardHistory = [entry, ...newHistory].slice(0, 20); - } + // Always add a new text entry, even if content matches an existing entry + clipboardHistory = [entry].concat(newHistory).slice(0, 20); } } else { @@ -787,7 +772,7 @@ PanelWithOverlay { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom - height: 1 + height: Math.max(1, 1 * Theme.scale(screen)) color: Theme.outline opacity: index === appList.count - 1 ? 0 : 0.10 }