https://bugs.kde.org/show_bug.cgi?id=516848

Noah Davis <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
                   |ma/spectacle/-/commit/7dd8f |ma/spectacle/-/commit/393d4
                   |49ad555428eea695c5bfebd806a |be54e2482cc6bd7d84a5bb4f0df
                   |72c9c7c0                    |46cd326f

--- Comment #7 from Noah Davis <[email protected]> ---
Git commit 393d4be54e2482cc6bd7d84a5bb4f0df46cd326f by Noah Davis.
Committed on 30/09/2026 at 19:36.
Pushed by ndavis into branch 'Plasma/6.8'.

Prevent premature exit during recording startup

I encountered this issue mostly in a VM. It appears to be a race between the
application lifecycle and asynchronous operations. I addressed it by adding a
separate `QEventLoopLocker`.

During testing, I added debug logging with `qWarning()` to
`SpectacleCore::startRecording()`, `VideoPlatformWayland::selectAndRecord()`,
`QCoreApplication::aboutToQuit`, `ScreencastingStream::created`, and
`PipeWireRecord::stateChanged`. This produced the following log:

```text
0.000 startRecording Screen captureWindows 1
0.000 hiding capture windows
0.002 calling VideoPlatform::startRecording
0.002 requesting KWin screen selection
1.115 KWin selection reply valid
1.115 selected screen "Virtual-1"
1.115 screencasting stream object created; awaiting created/failed signal
1.190 QCoreApplication::aboutToQuit
1.227 PipeWireRecord::stateChanged ... Idle
```

The `ScreencastingStream::created` signal is never emitted, the application
does not reach the `Recording` state, and no recording file is created.

After adding `QEventLoopLocker`:

```text
0.000 startRecording Screen captureWindows 1
0.000 installing QEventLoopLocker
0.000 hiding capture windows
0.002 calling VideoPlatform::startRecording
0.002 requesting KWin screen selection
1.336 KWin selection reply valid
1.336 selected screen "Virtual-1"
1.337 screencasting stream object created; awaiting created/failed signal
1.364 ScreencastingStream::created 61
1.515 PipeWireRecord::stateChanged ... Recording
```

With this change, the recording reached the `Recording` state and the video was
recorded successfully.

(cherry picked from commit 7dd8f49ad555428eea695c5bfebd806a72c9c7c0)

Co-authored-by: Zhora Zmeykin <[email protected]>

M  +9    -2    src/SpectacleCore.cpp
M  +1    -0    src/SpectacleCore.h

https://invent.kde.org/plasma/spectacle/-/commit/393d4be54e2482cc6bd7d84a5bb4f0df46cd326f

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to