DMA-BUF size may not match size from handleRemoteDesktopStarted()
See !61 (merged) for discussion.
I recently upgraded my laptop to Fedora Rawhide and found that Krfb immediately crashed with a segfault upon opening, after accepting the request from xdg-desktop-portal.
Upon some troubleshooting I determined the root cause was that the PWFrameBuffer::videoSize
did not match my screen resolution (or more importantly the DMA-BUF size). This led to an undersized buffer being passed to DmaBufHandler::downloadFrame()
from kPipewire. The resulting behavior ranged from EGL errors, to segfaults, to a kwin compositor crash (which recovered all QT-based clients automatically).
I'm not sure why https://invent.kde.org/network/krfb/-/blob/master/framebuffers/pipewire/pw_framebuffer.cpp?ref_type=heads#L337 isn't returning a valid size. It may be worth determining that before accepting this patch.
setVideoSize(qdbus_cast<QSize>(streams.first().map[QStringLiteral("size")].value<QDBusArgument>()));