mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
clipboard: prevent restart spin loop of watchers. Fix #1954
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user