mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-20 10:14:01 -04:00
launcher: keep the shift+enter paste process alive after the launcher closes
fixes #3586
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user