mutter draws flickering cursor artifacts on top of screencasts of virtual monitors
Affected version: mutter/main, gnome-shell/main
This issue is very visible since at least GNOME 45.
Reproduction steps:
- Create a screencast session using mutters dbus interfaces (e.g. by using g-r-d)
- Create a virtual monitor stream using
RecordVirtual()
with the cursor modemetadata
- Optionally create another virtual monitor in the same screencast session, as this bug is much more visible on secondary virtual monitors created in the same screencast session
Observation: While the cursor bitmap is received as metadata, the cursor is also occasionally (or rather a bit more than occasionally) painted on top of the actual monitor (which is not wanted). This cursor artifact might be directly be painted over, so it just flickers shortly, but sometimes this does not always happen (see the screencasts below)
Reproduced here with g-r-d, where mutter runs in a nested dbus session (no physical monitors are here present)
With g-r-d's RDP backend, this is lesser visible with one monitor (compared to g-r-d's VNC backend), as the cursor artifact seems to be directly painted over by mutter. I think this is due to that g-r-d's VNC backend only sends the updated cursor position to mutter, when the x- or y-pos actually changed, while the RDP backend just forwards everything to mutter.
Reproduction with the RDP backend (screencast):
Bildschirmaufzeichnung_vom_2023-10-21__10-51-45
As you can see in the screencast, there is a following flickering cursor painted on top of the actual screencast (although the cursor mode metadata
is used). This should not happen at any time here.
Reproduction with the VNC backend (screencast):
Bildschirmaufzeichnung_vom_2023-10-21__10-55-05
As you can see in the screencast, the same behaviour can be reproduced with the VNC backend. The bug is here very visible with the loading cursor (when attempting to start gnome-terminal), where mutter just paints all these cursor artifacts on top the screencast stream. When moving over these cursors, mutter draws over them, so they disappear. But at the same time, new artifacts might be drawn over the same position.
This bug only happens with virtual monitors and only when RecordVirtual()
is used to invoke the stream.
CC: @jadahl We need to get rid of this bug for headless sessions (46.0), as we use virtual monitors there.