Make mouse exclusively active on focus?

Hello hello! ^^’

I’m starting here (hi! :smiley: New to Linux really) with a funny question…!

I’ve parsed through KDE settings and couldn’t find a way to make this happen… Is there a way to make it so my mouse cursor is ONLY affecting my currently focused window?
To make it so any non-focused window ignores my mouse cursor (until I focus it via a click or whatever)?

E.g.: I have a small game. If I move my cursor, it moves the camera.
I meta+tab on my browser.
The mouse cursor should appear and should stop moving my camera.
Since my browser is the focus? My mouse cursor should ONLY affect my browser.

hi, welcome.

settings > window behavior

has a slew of focus and focus stealing settings

from what you describe, it sounds like you want one of the click to focus options and stealing prevention set to extreme.

not sure you will find this all that comfortable for everyday use, but it may do what you want.

Hey there! Thanks for the idea :slight_smile:

I tested it and it doesn’t quite achieve what I’m looking for.

To elaborate…
My issue is that I use some software that detects mouse movement for a variety of purposes.

It can be games (the camera follows the mouse), sometimes it’s software that “locks” when unused, but if it detects mouse movement it auto-unlocks, …

My goal is:
If (A window is not focused)
Then (it ignores ANY mouse movement whatsoever)

Clicks are fine, I just don’t want unfocused windows to detect mouse movement. :slight_smile:

you can try exploring window rules for individual windows or applications but your desktop is always going to be aware of where the cursor is (or it should be) because that’s a big part of what a graphical desktop is for.

if you were to somehow succeed at making a window ignore the mouse, then there would be no way to click on it again to give it focus, you would need to resort to the keyboard.

Got it, thanks! It’s the default behavior on Windows, but I know it’s a different environment. I can live with that mild inconvenience :slight_smile: Thanks!