Bug 487294

Summary: casted cursor moves even when not moved over window
Product: [Plasma] kwin Reporter: Martin Bednar <martin+kde>
Component: screencastingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: akselmo, kde, martin+kde, nate, xaver.hugl
Priority: NOR    
Version: 6.0.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Martin Bednar 2024-05-20 19:58:42 UTC
Casted cursor moves even when shared window not in focus.

STEPS TO REPRODUCE
1.  2 displays (might not be relevant, but makes seeing it easier)
2. Share one window only using firefox (tested to https://onlinescreenshare.com/ )
3. place another window over shared window

OBSERVED RESULT
Cursor in casted video moves over shared window, although in reality (ie locally) focus is on another window.


EXPECTED RESULT
No cursor movement if shared window not in focus


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo 2.15/kernel 6.6.30
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.0.0
Qt Version: 6.7.0
Comment 1 Martin Bednar 2024-05-20 20:00:43 UTC
Update: this happens even when the window is minimized: the casted cursor moves when moved over the last known window position.
Comment 2 Akseli Lahtinen 2024-05-24 09:33:47 UTC
Seems the cursor is always visible for me, no matter what im sharing, as long as the window is in same area the mouse cursor is.

If I fullscreen the shared window and minimize it the cursor is shared from the whole screen.
Comment 3 Bug Janitor Service 2024-06-19 11:42:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5945
Comment 4 Vlad Zahorodnii 2024-07-04 14:10:30 UTC
Git commit b452a5a5fbbf3509051cd26a75df08822964eaf3 by Vlad Zahorodnii.
Committed on 04/07/2024 at 13:50.
Pushed by vladz into branch 'master'.

plugins/screencast: Hide cursor if another window covers screencasted window

M  +20   -0    src/plugins/screencast/outputscreencastsource.cpp
M  +5    -0    src/plugins/screencast/outputscreencastsource.h
M  +20   -0    src/plugins/screencast/regionscreencastsource.cpp
M  +5    -0    src/plugins/screencast/regionscreencastsource.h
M  +4    -10   src/plugins/screencast/screencastmanager.cpp
M  +6    -0    src/plugins/screencast/screencastsource.h
M  +7    -16   src/plugins/screencast/screencaststream.cpp
M  +1    -3    src/plugins/screencast/screencaststream.h
M  +24   -0    src/plugins/screencast/windowscreencastsource.cpp
M  +5    -0    src/plugins/screencast/windowscreencastsource.h

https://invent.kde.org/plasma/kwin/-/commit/b452a5a5fbbf3509051cd26a75df08822964eaf3