Mouse cursor always visible - macOS and OpenGL

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
User avatar
almeath
Posts: 180
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Mouse cursor always visible - macOS and OpenGL

Post by almeath »

I am using ScummVM 2.7.0 under macOS Ventura 13.2

When I use the OpenGL graphics mode, I always see the macOS mouse cursor floating on top of the screen when in fullscreen mode. It does not show up when I take screenshots, so I cannot show it here. For example, in Monkey Island, I will see the macOS cursor imposed directly on top of the in-game cross-hair cursor, and when I move the cursor around the screen, the two are not fully in sync .. the macOS cursor will outrun the cross-hair cursor by a couple of centimeters. This does not happen when using the SDL graphics mode.

When switching to window mode with option-return, the macOS mouse cursor will disappear when floating over the ScummVM window, but then reappear over the macOS desktop. After switching back to fullscreen mode, it reverts to the behavior described above.

It is annoying to see the OS cursor superimposed over the full screen game window, especially because I can only use shaders in OpenGL mode. It ruins the immersive effect to see two mouse cursors floating around, partially out of sync with each other.

Is there any way around this?

[edit] I can attach a photo taken from my iPhone, to show how it looks.
monkey island open gl macos
monkey island open gl macos
IMG_7922.jpeg (521.28 KiB) Viewed 12840 times
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Mouse cursor always visible - macOS and OpenGL

Post by criezy »

I cannot reproduce the issue on macOS Monterey 12.6. For me in fullscreen OpenGL only the game cursor is visible in all games I tried (including the Secret of Monkey Island). I also tried all three known way to go to fullscreen with the same result (using the Options dialog, using Alt-Enter, and using the green button in the window title bar). Maybe that is an issue specific to macOS Ventura.
Does it happen also if you capture the mouse (using Ctrl+M)?
User avatar
almeath
Posts: 180
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Mouse cursor always visible - macOS and OpenGL

Post by almeath »

I have performed some additional tests, with the following results.

1. The issue only occurs in Ventura. My Mojave installation on the same machine was not affected.

2. ScummVM 2.6.1 (November 2022) does not exhibit the problem, in either Ventura or Mojave.

So, it is specific to the combination of 2.7.0 (downloaded build) and Ventura 13.2.

I think my next step will be to try compiling a build of 2.8.x git on my High Sierra installation, and then testing it on Mojave and Ventura.

To answer your question, no, using the key command to capture the mouse has no effect. Once in full screen mode, via any method, the macOS cursor imposes itself.
User avatar
almeath
Posts: 180
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Mouse cursor always visible - macOS and OpenGL

Post by almeath »

I compiled 2.7.0 from the source on GitHub and it does not exhibit the cursor problem in either Ventura or Mojave. 2.8.0 from the latest source is also fine.

This suggests that whatever is causing the issue is directly related to the release binary provided for download.

To rule out anything inside the app package or my preferences file causing the problem, I temporarily replaced the 'scummvm' binary inside the app with the one I compiled myself, and the issue did not occur. Putting the original binary back caused the issue to return.

So, if the issue is therefore with the release binary, I do not know why the version I compile myself would not exhibit this issue. I compile it on a completely separate system (2015 MacBook Pro running High Sierra). I then run it on a 2019 iMac.

I am wondering on what specific system the macOS release binary is compiled?
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Mouse cursor always visible - macOS and OpenGL

Post by criezy »

The 2.6.1 and 2.7.0 release were compiled on the same system with the same SDL version and same compiler. Which ones they are depend on the CPU type (Intel or Apple Silicon).

For the Intel version there is no difference whatsoever in the way the 2.6.1 and 2.7.0 release where compiled. For Apple silicon however there is a small difference to fix compatibility with macOS 11. The the compilation is done on macOS 12.6 with SDL 2.0.16, but the 2.7.0 release targets macOS 11 as minimum requirement.
User avatar
almeath
Posts: 180
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Mouse cursor always visible - macOS and OpenGL

Post by almeath »

Interesting, thank you. It is hard to tell what might be happening here then. For now, I will use the version I compile myself, but for future incremental releases I will test again to see if the issue persists. It may be something specific to Ventura 13.2 which will subsequently be 'fixed'.
User avatar
almeath
Posts: 180
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Mouse cursor always visible - macOS and OpenGL

Post by almeath »

After extensive testing, I have found that the issue affects the release download of version 2.7.0, or any ScummVM binary I compile myself under High Sierra, Mojave or Ventura (both 2.7.0 and latest source).

The issue is hard to describe, so I have linked to a short video to demonstrate what is happening. Basically, launching ScummVM into the standard GUI is fine, and the cross-hair cursor shows up as normal. After launching any game in full screen mode, it starts out looking fine, but if the mouse cursor hits the edge of the screen, something triggers the macOS cursor to appear, super-imposed over the top of the ScummVM cursor. From that point forward, the macOS cursor will not go away, even when switching to windowed mode and then back into fullscreen mode. In fact, just immediately switching to windowed mode, and then back again, causes the same issue.

https://www.dropbox.com/s/jt7f24mnaa0py ... e.mp4?dl=0

Something is wrong with how fullscreen mode is working, at least in Ventura. I have never seen any earlier version of ScummVM manifest this behavior.

If this is happening across the board on Ventura systems, surely it is going to be noticed by others. Perhaps someone else can verify if they are experiencing this? It may seem like a minor issue, but as mentioned above, seeing the system cursor floating around on top of the game cursor somewhat spoils the full-screen experience.
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Mouse cursor always visible - macOS and OpenGL

Post by criezy »

Maybe this is related to https://github.com/libsdl-org/SDL/issues/5340 that was fixed in SDL 2.0.22?
Which SDL version are you using when you compile ScummVM yourself?
User avatar
almeath
Posts: 180
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Mouse cursor always visible - macOS and OpenGL

Post by almeath »

I am using the latest version of SDL2 (2.26.5) installed via Homebrew when I compile in Ventura. So I expect that patch is already in effect. Also, if the version of my SDL2 installation was the cause of the problem, it would not explain why the downloaded release from the ScummVM website is manifesting the same issue.

There are some signs that this issue could be wider than just ScummVM. I notice in Retroarch, that the mouse cursor will pop up when not wanted when using various overlay and shader combinations, in full screen mode. With overlays that simulate a CRT monitor, moving the mouse cursor around inside the virtual PC screen will work fine, and when the cursor is moved outside the perimeter of the virtual screen, the macOS mouse cursor will pop up, in a similar fashion to what I have described above.

Importantly, I do not see this incorrect cursor behavior in Mojave running on the same Mac, so I suspect this issue is specific to macOS Ventura and running in full screen mode. As to exactly why .. I am stumped.

I am going to look into whether builds of DOSBox that support SDL2 (i.e. DOSBox-X, Staging) are likewise affected.

EDIT: I just performed a quick test with the latest (downloaded) release of DOSBox-X. When I launch in windowed more, and then switch into full screen, the macOS mouse cursor appears super-imposed on the DOS window and is locked there. It cannot even be moved around. Going back to windowed mode releases the cursor. I am wondering now if this issue is related to deeper bugs in SDL2 under macOS Ventura.
User avatar
almeath
Posts: 180
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Mouse cursor always visible - macOS and OpenGL

Post by almeath »

After some further testing, I have gone ahead and logged a bug report for this.

https://bugs.scummvm.org/ticket/14433#comment:1

The issue I mentioned with DOSBox appears to have been a cursor lock setting, so it means ScummVM is the only SDL2-reliant app manifesting this behavior, that I have come across at least. Of course, I do not know if this is in fact an SDL issue, given the same thing is happening in OpenGL and SDL modes.
Post Reply