Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#12822 closed defect (fixed)

MAC: Cusor jumps at window edges with OpenGL + Fullscreen + AR Correction

Reported by: sluicebox Owned by: criezy
Priority: normal Component: Port: Mac OS X
Version: Keywords:
Cc: Game:

Description

When playing a game on Mac in OpenGL mode in fullscreen with Aspect Ratio correction, mousing to the edges isn't usable. The cursor jumps to a different location. For me, it's the lower corner of the screen.

To reproduce:

  1. Enable OpenGL rendering
  2. Enable Aspect Ratio Correction
  3. Start game (I tested with SCI but probably affects every engine)
  4. Switch to fullscreen with Option+Enter hotkey (or enable Fullscreen Mode in settings)
  5. Mouse to the left or right screen edge and the cursor jumps to the bottom when it hits the black edge.

Occurs with latest code under Big Sur 11.5 with an M1.

Possibly related to #10371 or #12646, but the cursor behaves nicely at the edges when I turn off Aspect Ratio Correction.

Change History (3)

comment:1 by criezy, 3 years ago

This is a regression from the HiDPI changes. Warping the cursor in the SDL Window does not use the correct coordinates on macOS.

I think the aspect ratio correction might be a red herring.

The issue occurs when the backend is trying to warp the cursor back inside the game area after the user moves it outside the game area. So it only happens if you have black bars on the side, which for me only happen when aspect ratio correction is on, or when playing a 640x480 game.

Another way to see the issue is to had hotkeys to move the mouse in the ScummVM options, and then use those. If you try to click after you moved the cursor that way, you will see that the cursor is not where you think it is. This is quite clearly visible in the Launcher. And you don't need to enable aspect ratio correction to reproduce that issue.

I suspect the only system affected by this bug currently is macOS when using retina screen due to differences in the way SDL handles HiDPI depending on the system (see the various hacks we already haven the backend because of that).

comment:2 by criezy, 3 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

This is fixed in 9449e177f4.

comment:3 by sluicebox, 3 years ago

Thanks! That fixed it. You're right, I guess the AR Correction's relevance was that for the games I was testing, that was the difference between having an black-bar area on the left and right versus the game filling the screen perfectly, and it was the black-bar area where the bug was triggered.

Note: See TracTickets for help on using tickets.