Screen scaling on linux - Cursor restrained to the upper-left part of the screen after alt-tab
Type
Game behaviour
Bug description
I'm on Linux (Arch with KDE on Xorg)
I play on a 2560x1440 but I reduced the game to 1920x1080 using screen scaling (75%). When I go back into the game after an alt-tab, sometimes (it's kinda random, I don't understand what's the trigger) my cursor gets locked in the upper-left part of the screen. I highlighted the approximate area in which my cursor can move in red in the screenshot bellow.
This only affects my mouse (my tablet can still move the cursor in the full window). I have raw input off (it does weird things if I enable it), and I disabled the integrated tablet driver to use my own OTD instance.
Relanching the game or disabling/re-enabling full-screen or changing the settings of the screen scaling seems to fix it temporarily but alt-tabbing again can just re-trigger it.
Screenshots or videos
Version
2023.1130.0-lazer
Logs
database.log input.log network.log performance.log runtime.log
Here is a small video to show what's happening and what I mean by random: https://github.com/ppy/osu/assets/10669609/cc0e331c-81b8-4055-8262-82baa9b617a3 (does not load in my firefox somehow ? Works fine in chromium though)
(I use Alt+Tab to switch windows)
I don't think screen scaling should have anything to do with this? As implemented screen scaling does not confine the cursor to the scaled area. As in, your mouse can and will be positioned over the letterboxed area, it just won't show a pointer. Related: https://github.com/ppy/osu/issues/12098
Can you double-check and confirm whether screen scaling is related here in any way?
I'm not sure we can provide a fix either as this is probably an SDL issue or at least related to SDL, and on a linux system this would likely require replicating your exact WM setup to reproduce. But let's cross that bridge later, I want to confirm that screen scaling has nothing to do with this.
As implemented screen scaling does not confine the cursor to the scaled area.
It does on full-screen when you select "Scale everything". At least on my end, I can't exit the scaled area, even when that bug is not triggered. If that's not intentional then I don't know what's causing this.
Can you double-check and confirm whether screen scaling is related here in any way?
I'll try tonight.
Okay, yeah, I apparently wasn't aware of the fact that it does confine in full-screen.
That said the linux caveats above still apply.
I tested and can confirm this is only happening with screen scaling when selecting "Scale Everything".
I can always reach the top-left corner of the scaled screen, but the bottom-right-most position I can reach depends on the settings. Here is different examples of the bottom-right-most position I can reach for different settings:
My guess would be that it applies some incorrect scaling to the cursor position somehow, since the first 2 screens look like a scaling of each other and in the last two screenshots the position of the cursor is the same.
Also, I just tried on Windows on the same machine with same settings and same monitors and it's not happening so it might be just linux. But I know I had some slight issues with my main monitor which is that it advertises a 2160p TV resolution and I think both windows and linux were using it by default instead of the correct 1440p PC resolution. This might be related. I'll try to fiddle a bit with my xorg settings on linux and see if it changes anything.
From my calculation, it is as if the game was assuming that my screen has a resolution of ~1367x768 (+/- 1 px) when computing the bottom-right-most cursor position.
Having the exact same issue when using screen scaling set to everything. Also using Arch Linux with KDE on X11 on a 1440p monitor.
Can reproduce on kubuntu 22.04 (kde, x11), on a 2160p monitor.
- screen resolution doesn't seem to matter; I changed my screen resolution to 720p and the bug still exists.
- sometimes I can move the cursor to the bottom-left region after resuming from alt-tab, but once I move the cursor to the "confined" region at top-left it cannot go back anymore.
- the bug disappears if both horizontal and vertical scalings are set to 100%.
- enabling high precision mouse fixes it completely for me, and I didn't notice any issue caused by that.
Would be interesting to test on Wayland to see if it's X11 specific. I'll check when I can.