Created attachment 145744 [details] Screensharing a whole screen only shows a black screen SUMMARY *** Trying to screenshare/screenrecord a whole screen on Wayland only shows a black screen with the cursor inside it. When selecting a single application the window shows fine in the stream, but the cursor isn't shown. xdg-desktop-portal-kde seems to be running according to System monitor. *** STEPS TO REPRODUCE 1. Open any screenshare/screenrecord application like Firefox, OBS Studio or even the xdg-desktop-portal-kde testing utility (https://invent.kde.org/libraries/xdg-portal-test-kde). 2. Choose to screenshare/screenrecord a whole screen or single window. 3. Select a screen or single window in the xdg-desktop-portal-kde dialog. OBSERVED RESULT Black screen with only a cursor when screensharing a whole screen, and the window content when screensharing a single window but whith no cursor. Below are attached some screenshots EXPECTED RESULT When selecting a whole screen the whole screen should be seen in the stream (or in the screencapture app like OBS Studio) with the cursor and when selecting a single window that window should be seen in the stream o app with the cursor. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.23.5 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.2 Kernel Version: 5.16.1-zen1-1-zen (64-bit) Graphics Platform: Wayland Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz Memory: 15.5 GiB of RAM Graphics Processor: NVIDIA GeForce RTX 2060/PCIe/SSE2 NVIDIA Driver Version: 495.46 ADDITIONAL INFORMATION On GNOME scrensharing on Wayland with xdg-desktop-portal-gnome works fine when sharing a whole screen or a single window, with cursor being captured in both cases.
The error occurs here: https://invent.kde.org/plasma/kwin/-/blob/c31288d2ad570d69bfa49268e7fb282169f24542/src/plugins/platforms/drm/egl_gbm_backend.cpp#L713 Kwin logs "kwin_wayland_drm: Failed to record frame: Error creating EGLImageKHR - 12300 " after switching glGetError() to eglGetError(), which is EGL_BAD_PARAMETER. Already tried using EGL_NO_CONTEXT like it suggests in the spec for EGL_NATIVE_PIXMAP_KHR but still see the same error.
Created attachment 146100 [details] OBS Studio log file Can confirm. Occurs in my computer too in Arch Linux with NVIDIA.
This is still broken with new Plasma 5.24.0 update and Nvidia drivers v510.47.03 :/
Lately (or only in my case?) this is not KDE specific. I tested on Gnome on Fedora 36. Screencapture is also black there.
(In reply to Elias from comment #4) > Lately (or only in my case?) this is not KDE specific. I tested on Gnome on > Fedora 36. Screencapture is also black there. Yup it's affecting all DEs.
*** This bug has been marked as a duplicate of bug 448839 ***