It's impossible to debug my game on Ubuntu/Gnome when my game captures the mouse

Godot Version

v4.3.stable.mono.official [77dcf97d8]

OS

Ubuntu 24.04.1 LTS with gnome version 46

IDE

JetBrains Rider 2024.2.5

Question

My game captures the mouse on startup, as any modern game would, but this causes an issue when either the game crashes in debug mode, or when I insert a breakpoint in my C# code. The breakpoints are properly hit, and when the game crashes I get the proper information about the crash, but my mouse is completely gone and I cannot get it back until I completely kill my game process, which makes it really difficult to debug or examine the code in the debug state, or to step through the code.

What I tried so far:

Switch to another workspace (Does not work, the mouse is still gone)

Kill the game process (This works, but it makes it impossible to step through the code and actually debug issues, so this is a no-go)

Always keeping the mouse unlocked is obviously a non-solution, especially for issues that aren’t specific to the UI. By this point I’m at a loss for what to do, the same project on a Windows machine does not have this problem, because as soon as the breakpoints are hit (or the game crashes), the mouse is once again there and no longer captured by the unresponsive game.

Any help is greatly appreciated!

This seems like the obvious one; if you need the mouse, then you need the mouse. Why not just for debug/in-editor while you’re fixing bugs?

If the issue I’m trying to debug is related to movement, specifically camera movement with the mouse in 3D, things become very finicky. Besides, this does not sound like intended behaviour, as the same thing does not happen on Windows.

That’s a tough one, especially as it doesn’t occur for me (albeit it not gnome). If the issue relies on movement (but not necessarily using the mouse), is it possible to abstract the movement case and force the issue (while finicky is possible, a test case is better)? That said, if you can do it on Windows (that is, it isn’t specific to Linux), you can resolve the crash?

Perhaps also an exception handler (again #if DEBUG) to unlock the mouse (but perhaps still finicky)