mojira.dev
MC-312297

Under certain circumstances, switching back to the game in certain ways causes the cursor's position to remain unlocked whenever it should be captured by the game

This issue first appeared in 26.3 Snapshot 4.

I’m a Mac user, but I appreciate the advantages of Windows' alt+tab over macOS' command+tab, and today I decided to install the third-party AltTab utility to get things working more to my liking. On the whole I’m quite impressed with it, but it seems to have a strange interaction with Minecraft in particular, only for the versions of Minecraft which use SDL: if you have Minecraft in non-exclusive (i.e. macOS) fullscreen, and switch focus back to it using AltTab, then while in the game view (i.e. not in a menu or GUI), the cursor will usually remain hidden but will continue to move around the screen, and when it reaches the edge, can reveal the menu bar and Dock if “Menu/Dock Visibility” is enabled in video settings. Even if this setting is disabled, because I’m playing on a modern MacBook with a display notch, the cursor can still find its way up into the black space at the top of the screen, and while it is there, cursor tracking and clicks are not picked up by the game, making it appear as if my mouse and trackpad have temporarily stopped working. These issues make it essentially impossible to play survival Minecraft in macOS fullscreen mode while using AltTab as a replacement for command+tab.

To reproduce

  1. Be on Mac

  2. Install AltTab and set it up to your liking

  3. Launch Minecraft, and set it to non-exclusive (i.e. macOS) fullscreen mode if it did not launch directly into it

  4. Load into a world

  5. Make large camera movements
    ✔ Everything works fine

  6. Switch to another app by any means

  7. Switch back to Minecraft using AltTab (by default, press and then release option+tab, as you would with command+tab)

  8. Return to the game view and make large camera movements as you did before
    ❌ The cursor does not get locked properly, and can reveal your menu bar and dock if “Menu/Dock Visibility” is enabled, as well as fly up into the black bar at the top of your screen if you’re playing on a MacBook with a display notch

  9. Pause the game, quit AltTab from the menu bar, then switch to another app and back by any means
    ❌ The problem persists

  10. Exit and re-enter macOS fullscreen
    ✔ The problem has been fixed

Expected behavior

The cursor would always remain in the center of the screen, locked and invisible, while the player is not in a menu or GUI

Note

I do not know if there is a way to trigger this issue without the use of third-party software. I have never noticed this issue when returning to Minecraft using command + tab, Mission Control, clicking the Dock icon or three-finger-swiping, and have not tested switching to the game with Stage Manager, AppleScript or other means.

Environment

macOS Golden Gate 27.0.1

Linked issues

Attachments

Comments 5

I can confirm this happens on Windows 10 as well, and MC-312114 seems to describe something similar on Linux.

Can you upload a video recording of the issue on Windows with the debug overlay (F3) enabled and showing the game version and system specs? I’m a bit surprised to hear that it happens on other OSs and want to make sure this really is the same issue.

The problem for me seems to mainly occur if I tab out and then regain window focus with my cursor anywhere outside the actual game window. I don’t get the problem just from alt-tabbing, but I’d imagine that’s because that’s a native OS feature on Windows; it seems the common thread here is that the game is failing to capture the cursor if the window regains focus in a way it’s not “expecting.” In any event the actual symptoms are identical, if not the causes.

That does seem like the same issue. I’ve retitled this report so that encompasses all OSes.

clamlol

(Unassigned)

Community Consensus

Platform HC

Normal

Input

26.3, 26.4 Snapshot 2

Retrieved