Bug 434460

Summary: Feature to automatically move the cursor to the center of a window when it becomes active
Product: [Plasma] kwin Reporter: Eduardo <pereyraeduardo>
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: wishlist CC: nate
Priority: VLO    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Eduardo 2021-03-15 19:35:58 UTC
Hi, the mouse warping functionality is very helpfull when using a trackpoint in a window manager. It surprises me that this option is not available in a mature WM like Kwin. 
Could this be implemented? 

Thanks in advance.
Comment 1 Nate Graham 2021-03-15 21:33:19 UTC
Can you describe what "mouse warping functionality" is? I'm not familiar with that term.
Comment 2 Eduardo 2021-03-16 00:24:04 UTC
(In reply to Nate Graham from comment #1)
> Can you describe what "mouse warping functionality" is? I'm not familiar
> with that term.

Sure. Basically when switching focus between windows, the pointer is automatically positioned to the centre of the new focused window. 
This is very helpful in a keyboard oriented workflow.
Comment 3 Nate Graham 2021-03-17 18:28:43 UTC
Thanks! Speaking personally, that functionality would drive me insane, and I imagine it would drive most people insane, such that I could see turning it on being used as a prank. In general, users hate it when the cursor is *ever* moved automatically.

Of course those users wouldn't be the target audience of this feature, I imagine.
Comment 4 Eduardo 2021-03-17 19:26:12 UTC
Really? Is very handy if you are "keyboard oriented" and have to switch between GUI and CLI aplications without a mouse. 
This feature is present in most tiling WM like i3 and bspwm, and the Kröhnkite kwin script is becoming very popular, so I think this will become really handy. 
I've tried some python scripts but they don't work very well and I thought that this should be built-in. 
Anyway, thanks for reporting it!
Comment 5 Nate Graham 2021-03-17 21:23:25 UTC
Oh, this feature is already provided by Kröhnkite? Then I guess there's no need to add it into KWin itself. KWin maintains a robust scripting interface precisely so that niche use cases like these can be fully supported without having to add potentially dangerous features that could terrify ordinary users (to the average user, having the cursor moved automatically ranges from somewhere between "infuriating" and "evidence that I'm being hacked").
Comment 6 Eduardo 2021-03-17 21:27:23 UTC
No, it's not provided by Kröhnkite or any other kwin script at the moment. 
Some people tried to implement this feature with kwin scripts but it wasn't possible because some api wasn't exposed.
Comment 7 Nate Graham 2021-03-17 21:29:21 UTC
Oh, then we should expose that API. Can you find out which one is needed and open a bug report about it?