diff --git a/Services/Keyboard/ClipboardService.qml b/Services/Keyboard/ClipboardService.qml index b2169334f..db646c9a2 100644 --- a/Services/Keyboard/ClipboardService.qml +++ b/Services/Keyboard/ClipboardService.qml @@ -251,27 +251,43 @@ Singleton { id: watchText stdout: StdioCollector {} onExited: (exitCode, exitStatus) => { - if (root.autoWatch && root.watchersStarted) { - Qt.callLater(() => { - watchText.running = true; - }); + if (root.autoWatch && root.watchersStarted && Settings.data.appLauncher.clipboardWatchTextCommand.trim() !== "") { + watchTextRestartTimer.restart(); } } } + Timer { + id: watchTextRestartTimer + interval: 1000 + repeat: false + onTriggered: { + if (root.autoWatch && root.watchersStarted) + watchText.running = true; + } + } + // Image watcher Process { id: watchImage stdout: StdioCollector {} onExited: (exitCode, exitStatus) => { - if (root.autoWatch && root.watchersStarted) { - Qt.callLater(() => { - watchImage.running = true; - }); + if (root.autoWatch && root.watchersStarted && Settings.data.appLauncher.clipboardWatchImageCommand.trim() !== "") { + watchImageRestartTimer.restart(); } } } + Timer { + id: watchImageRestartTimer + interval: 1000 + repeat: false + onTriggered: { + if (root.autoWatch && root.watchersStarted) + watchImage.running = true; + } + } + // Capture current clipboard text when needed Process { id: captureTextProc