Review everything shipped this weekend, and fix what the reviewers caught
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -87,9 +87,19 @@ Singleton {
|
||||
return output ? root.absentSink : root.absentSource;
|
||||
}
|
||||
|
||||
// Assigning `running = true` to a Process that is already running is a
|
||||
// no-op, not a queue. The default sink and source change together, so the
|
||||
// two Pipewire signals below arrive back to back and the second read was
|
||||
// always the one dropped -- which is how a ghost row survived the device
|
||||
// coming back. Remembered here and re-run from reader.onExited instead.
|
||||
property bool refreshPending: false
|
||||
|
||||
function refresh(): void {
|
||||
if (reader.running)
|
||||
if (reader.running) {
|
||||
root.refreshPending = true;
|
||||
return;
|
||||
}
|
||||
root.refreshPending = false;
|
||||
reader.command = root.fixturePath !== ""
|
||||
? ["cat", root.fixturePath]
|
||||
: ["pw-metadata", "-n", "default", "0"];
|
||||
@@ -173,6 +183,10 @@ Singleton {
|
||||
: "PipeWire's remembered default devices could not be read.";
|
||||
if (code !== 0)
|
||||
root.loaded = true;
|
||||
// Deferred a turn so this read's stdout is parsed before the next
|
||||
// one starts filling the same collector.
|
||||
if (root.refreshPending)
|
||||
Qt.callLater(() => root.refresh());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user