launcher: keep the shift+enter paste process alive after the launcher closes

fixes #3586
This commit is contained in:
bbedward
2026-09-27 11:41:55 -04:00
parent 5623476126
commit 4b00c047da
2 changed files with 12 additions and 16 deletions
@@ -2,7 +2,6 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Common
import qs.Services
import "Scorer.js" as Scorer
@@ -150,19 +149,6 @@ Item {
}
}
Process {
id: copyProcess
running: false
onExited: pasteTimer.start()
}
Timer {
id: pasteTimer
interval: 200
repeat: false
onTriggered: ClipboardService.sendPasteKeystroke()
}
function pasteSelected() {
if (!selectedItem)
return;
@@ -185,8 +171,7 @@ Item {
const pasteArgs = AppSearchService.getPluginPasteArgs(pluginId, selectedItem.data);
if (!pasteArgs)
return;
copyProcess.command = pasteArgs;
copyProcess.running = true;
ClipboardService.pasteAfterCommand(pasteArgs);
itemExecuted();
}
+11
View File
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import qs.Common
import qs.Services
@@ -47,6 +48,11 @@ Singleton {
onTriggered: root.sendPasteKeystroke()
}
Process {
id: pasteCommand
onExited: pasteTimer.start()
}
Connections {
target: DMSService
function onIsConnectedChanged() {
@@ -74,6 +80,11 @@ Singleton {
return terminalAppIds.includes(appId) || appId.endsWith("term") || appId.includes("terminal");
}
function pasteAfterCommand(command) {
pasteCommand.command = command;
pasteCommand.running = true;
}
function sendPasteKeystroke() {
DMSService.sendRequest("clipboard.sendPaste", {
"shift": isTerminalFocused()