clipboard history: remove unnecessary refreshes

This commit is contained in:
end-4
2025-05-29 11:44:52 +02:00
parent 89203e8794
commit 4b0ee5b8ab
2 changed files with 0 additions and 11 deletions
@@ -192,7 +192,6 @@ Scope {
GlobalStates.overviewOpen = false; GlobalStates.overviewOpen = false;
return; return;
} }
Cliphist.refresh()
for (let i = 0; i < overviewVariants.instances.length; i++) { for (let i = 0; i < overviewVariants.instances.length; i++) {
let panelWindow = overviewVariants.instances[i]; let panelWindow = overviewVariants.instances[i];
if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) { if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) {
@@ -23,11 +23,6 @@ Item { // Wrapper
implicitHeight: searchWidgetContent.implicitHeight + Appearance.sizes.elevationMargin * 2 implicitHeight: searchWidgetContent.implicitHeight + Appearance.sizes.elevationMargin * 2
property string mathResult: "" property string mathResult: ""
property bool lastQueryWasClipboard: false
onShowResultsChanged: {
lastQueryWasClipboard = false;
}
function disableExpandAnimation() { function disableExpandAnimation() {
searchWidthBehavior.enabled = false; searchWidthBehavior.enabled = false;
@@ -298,10 +293,6 @@ Item { // Wrapper
///////////// Special cases /////////////// ///////////// Special cases ///////////////
if (root.searchingText.startsWith(ConfigOptions.search.prefix.clipboard)) { // Clipboard if (root.searchingText.startsWith(ConfigOptions.search.prefix.clipboard)) { // Clipboard
if (!root.lastQueryWasClipboard) {
root.lastQueryWasClipboard = true;
Cliphist.refresh(); // Refresh clipboard entries
}
const searchString = root.searchingText.slice(ConfigOptions.search.prefix.clipboard.length); const searchString = root.searchingText.slice(ConfigOptions.search.prefix.clipboard.length);
return Cliphist.fuzzyQuery(searchString).map(entry => { return Cliphist.fuzzyQuery(searchString).map(entry => {
return { return {
@@ -311,7 +302,6 @@ Item { // Wrapper
type: `#${entry.match(/^\s*(\S+)/)?.[1] || ""}`, type: `#${entry.match(/^\s*(\S+)/)?.[1] || ""}`,
execute: () => { execute: () => {
Hyprland.dispatch(`exec echo '${StringUtils.shellSingleQuoteEscape(entry)}' | cliphist decode | wl-copy`); Hyprland.dispatch(`exec echo '${StringUtils.shellSingleQuoteEscape(entry)}' | cliphist decode | wl-copy`);
Cliphist.refresh()
} }
}; };
}).filter(Boolean); }).filter(Boolean);