Bug 473275

Summary: Desktop sharing makes mouse lag on Wayland
Product: [Plasma] kwin Reporter: james
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: aleixpol, jgrulich, nate
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.27.7   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.0
Sentry Crash Report:

Description james 2023-08-11 08:50:51 UTC
SUMMARY

My system has an Nvidia 1080TI connected to two 4K displays. I am using the NVidia proprietary drivers (v. 535.98) and kernel 6.4.9-arch1-1.

When I try to share one of my displays, for example in microsoft teams, or using the test tool here: https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/#3987330391542372 then my mouse becomes incredibly laggy and makes the system virtually unusable.

Interestingly if I instead share a window, even a maximised window that takes up virtually the whole screen (minus the taskbar) performance seems fine so it doesn't seem to be performance constrained by hardware.

This problem only occurs in Wayland, everything is smooth in X11.

STEPS TO REPRODUCE
1. Go here: https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/#3987330391542372
2. Click share screen. Choose entire screen and then select one of your displays.
3. Try to move the mouse around and notice it is very laggy.

OBSERVED RESULT
Mouse lags making system unusable until screen sharing is turned off again.

EXPECTED RESULT
Mouse moves freely.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
NVidia proprietary drivers (v. 535.98)
Kernel 6.4.9-arch1-1.

ADDITIONAL INFORMATION
Comment 1 james 2023-08-11 08:59:05 UTC
Oh btw this is using Google Chrome: 114.0.5735.90 (Official Build) (64-bit).

I tried Firefox as well but the screen sharing is totally broken - it just shares a black screen with a cursor moving around but the contents of the desktop are not visible.
Comment 2 Nate Graham 2023-08-11 17:10:00 UTC
This should be fixed in Plasma 6 due to code changes to use a separate thread for input events.