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
|
id: watchText
|
||||||
stdout: StdioCollector {}
|
stdout: StdioCollector {}
|
||||||
onExited: (exitCode, exitStatus) => {
|
onExited: (exitCode, exitStatus) => {
|
||||||
if (root.autoWatch && root.watchersStarted) {
|
if (root.autoWatch && root.watchersStarted && Settings.data.appLauncher.clipboardWatchTextCommand.trim() !== "") {
|
||||||
Qt.callLater(() => {
|
watchTextRestartTimer.restart();
|
||||||
watchText.running = true;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: watchTextRestartTimer
|
||||||
|
interval: 1000
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
if (root.autoWatch && root.watchersStarted)
|
||||||
|
watchText.running = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Image watcher
|
// Image watcher
|
||||||
Process {
|
Process {
|
||||||
id: watchImage
|
id: watchImage
|
||||||
stdout: StdioCollector {}
|
stdout: StdioCollector {}
|
||||||
onExited: (exitCode, exitStatus) => {
|
onExited: (exitCode, exitStatus) => {
|
||||||
if (root.autoWatch && root.watchersStarted) {
|
if (root.autoWatch && root.watchersStarted && Settings.data.appLauncher.clipboardWatchImageCommand.trim() !== "") {
|
||||||
Qt.callLater(() => {
|
watchImageRestartTimer.restart();
|
||||||
watchImage.running = true;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: watchImageRestartTimer
|
||||||
|
interval: 1000
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
if (root.autoWatch && root.watchersStarted)
|
||||||
|
watchImage.running = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Capture current clipboard text when needed
|
// Capture current clipboard text when needed
|
||||||
Process {
|
Process {
|
||||||
id: captureTextProc
|
id: captureTextProc
|
||||||
|
|||||||
Reference in New Issue
Block a user