Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions shell/plugins/clipboard/Clipboard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ Item {
onExited: {
currentProc.running = true
textWatchProc.running = true
imageWatchProc.running = true
}
}

Expand All @@ -289,14 +288,7 @@ Item {
}
}

Process {
id: imageWatchProc
command: ["setpriv", "--pdeathsig", "TERM", "wl-paste", "--type", "image/png", "--watch", root.captureScript, "image/png"]
onExited: watchRestartTimer.restart()
stdout: SplitParser {
onRead: function(data) { root.addClipboardJson(data) }
}
}


// A watcher that dies takes clipboard history with it, silently: copying still
// works, the picker still opens, and the old entries are all still there, so
Expand All @@ -307,7 +299,6 @@ Item {
repeat: false
onTriggered: {
if (!textWatchProc.running) textWatchProc.running = true
if (!imageWatchProc.running) imageWatchProc.running = true
}
}

Expand Down
8 changes: 4 additions & 4 deletions test/shell.d/clipboard-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ assert(
'clipboard text watcher dies with the shell via pdeathsig'
)
assert(
clipboardQml.includes('command: ["setpriv", "--pdeathsig", "TERM", "wl-paste", "--type", "image/png", "--watch", root.captureScript, "image/png"]'),
'clipboard image watcher dies with the shell via pdeathsig'
!clipboardQml.includes('wl-paste", "--type", "image/png", "--watch'),
'clipboard avoids watching images to prevent consuming single-use Wayland pipes'
)
assert(
clipboardQml.includes('command: ["pkill", "-f", "wl-paste .*--watch .*/shell/plugins/clipboard/capture\\\\.sh"]'),
'clipboard init reaps stale watchers before starting new ones'
)
assertEqual(
(clipboardQml.match(/onExited: watchRestartTimer\.restart\(\)/g) || []).length,
2,
'clipboard respawns both watchers when they die'
1,
'clipboard respawns the text watcher when it dies'
)

assertDeepEqual(
Expand Down