Cursor not rendering over certain objects in Linux

Overview

My project is a first person game, so for most of the gameplay the cursor is in state CursorLockMode.Locked, but when the character is inspecting control panels, the cursor should be free. This behaviour has been reliable in the Editor and in Standalone Windows, but when building to Linux, the cursor doesn’t always free itself when the player inspects.

Here is a screenshot of a player inspecting a control panel with a “Monitor” model:

This is where the issue lies. When the player inspects this control panel in the cursor immediately switches to CursorLockMode.None, but in Standalone Linux the cursor remains invisible, until the mouse is moved outside of the zone I’ve marked with the red corners. When the cursor leaves this zone, it immediately becomes visible, and the player can move it back over the monitor to use it (from that point on, it will remain visible).

The (Relevant) Code

void OnGUI() {
        if (gameManager.isPaused || player.inspecting) {
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible = true;
        }
        else {
            Cursor.lockState = CursorLockMode.Locked;
        }
    }

I’m confident that this is switching the states correctly (player.inspecting is switched immediately after the player right clicks).

The Shader

My best theory is that this is shader related. The mesh contained within the problematic zone uses a unique shader to display a render texture with that CRT effect. As far as I can tell, it is the only unique part about this object in particular.

But can shaders even effect the cursor? I’ve been unable to find any information on this elsewhere.

What I Have Tried

I have viewed the following similar issues:

I have subsequently attempted variations such as:

if (gameManager.isPaused || player.inspecting) {
    Cursor.lockState = CursorLockMode.None;
    Cursor.visible = false;       // Adding this line
    Cursor.visible = true;
}
else {
    Cursor.lockState = CursorLockMode.Locked;
}

and

if (gameManager.isPaused || player.inspecting) {
    Cursor.lockState = CursorLockMode.None;
    Cursor.visible = true;
}
else {
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.visible = false;       // Adding this line
}

and also using void Update() rather than void OnGUI().

But nothing has made a difference.

I am using Ubuntu 24.04 to troubleshoot, but I’ve had players report this issue in other distros as well.

If you have any ideas, please share, as I am well and truly out of them!

Thanks heaps,

Luna

(I would have provided more links and images, but I’m limited since this is my first post :P)