Mouse speed on Wayland

For a while I have been bothered by the mouse speed between X11, Wayland and Windows. This stems from the fact that someone decided that on Wayland when the screen is scaled by a percentage to also scale the mouse with the same percentage.

This is wrong.

If I for example scale a 1080p screen by 200% to get to 4K, my mouse speed should stay the same. Why? I am still working on a 4K screen with a 4K resolution.

This currently results in some weird behavior, not only is the mouse twice as fast on Wayland compared to X11 or Windows where I use the same 200% scales. In games that run on Proton (Steam) it completely ignores whatever I set (0.5) in Plasma to compensate for the increase in speed… so these games are all at twice the mouse speed!

Now for most people going from 500DPI to 1000DPI would probably feel a lot “smoother” or “faster”, but when you are already at 10k and now your mouse sits at 20k… even I can not control it anymore!

I have once read some post somewhere regarding this issue where some developer strongly believed that the speed of the mouse should be scaled up, but I can’t find it anymore so now I am here to ask for help.

Someone has to understand that the speed of the cursor should not be changed if the view port resolution stays the same?

It should be scaled (i.e. in logical pixel instead of physical pixel). Consider this scenario:

You have two 14in monitors, one 1920x1080, the other 3840x2160. And you have 1x scaling on the first one and 2x on the second, so app windows would be the same physical size on both screens. Then I assume you would want the mouse cursor to also move in the same physical speed on both screens?

The same for 14in laptops with screens of different resolutions (thus different DPI). IIUC Plasma chooses a default scaling factor, so they all have a logical DPI close to 96, so UI has similar physical sizes on them. Then, mouse should use that scaling too, so mouse cursor would move at the same physical speed by default.

Yes, it’s assumed that you use the scaling to display UI at roughly the same physical size on screens with different DPI than 96. The logic kind of falls apart if you use the scaling just because you prefer larger-than-default UI.

Of course this would create problem in FPS games, where the mouse doesn’t control a cursor on screen, so it shouldn’t be scaled there. Maybe these games should use a different API to get raw mouse movements instead of a scaled absolute cursor position. (But when the game is paused and you are using the mouse to control a cursor on screen, it should use the “normal” API instead)

1 Like

I understand why it should be scaled, but the “resolution” reported to the application should be scaled down instead.

Move your mouse from the bottom left to the top right on a 4K screen, now display a 1080p picture on the same 4K screen and move your mouse from bottom left to top right.

The mouse should move at the same speed, not twice as fast. The x and y coordinates reported should be halved in this situation.

edit: you also have to imagine out of all the OSes and DWM’s we have only Wayland has this behavior. Windows, OS X, Android and whatever you can think of all do not speed up the mouse when you use scaling… because the resolution of the viewport does not change.

Again, it seems unreasonable if you use scaling because you prefer a larger UI. But the original purpose is to draw the UI in a logical resolution of about 96DPI.

It’s assumed that with the correct scale set, UI elements, e.g., a button, would be roughly the same physical size (in millimeters, not pixels) on any screen. (I.e., one logical pixel should be roughly 1/96 inch on any screen.) And naturally, it should take roughly the same physical movement (in millimeters) of mouse to move from one edge of the button to the other.

So, since with 2x scale, the button would be 2x larger on your screen, the mouse should be moving 2x faster.

1 Like

looking at @sfjuocekr 's post, it seems, that the Game is getting the faster speed passed through, and doesn’t handle it in the same way Plasma does.
because the game is at 100% scale, it maps mouse from the whole monitor to a quarter, but displays it at 4k again
hope that’s remotely comprehendable :eyes:

Mouse position is reported in logical coordinates to the app. It doesn’t matter with what resolution the app renders in.

then it has to be the games fault, right?