I have had this issue and here is my theory. I think it is fine. I think it is the nature of working in the editor itself. If you run the game in stand alone or fully built mode I think it will work fine.
The problem may be that when you switch to the cursor on or off in the editor game the focus switches back to the editor itself instead of staying within the game (like when you hit Shift+F1). That is why you have to first click in the window to get context back to the game playing in the editor (again my theory not tested fact)
However that does not mean it is not a bug so maybe we should switch this question to the actual bug report
Unfortunately the problem is exactly the same when launching as standalone, cooked binary, new editor window, or in editor. This is an issue with the way mouse input is handled internally.
See, the bShowMouseCursor flag is much more than its name says. It changes the way the mouse is handled, on Linux it looks to be resetting the mouse position to mid-screen when clicking for example, on Windows it causes various focus issues.
I would like to simply make the cursor disappear (just not drawing it), preferably without patching the engine.
Well without patching the engine you could toggle on or off a user widget that represents the location of the mouse cursor and turns off any mouse input you may have (like camera rotations, etc)… You’d have to update it each frame but that’s not uncommon. I used a video a long time ago on how to create a custom mouse widget that may do exactly what you want.
Yeah, but on Linux, doing that will reset the mouse position every time you click on something. What I need is the (correct) behaviour of bShowMouseCursor, without the cursor itself. bShowMouseCursor set to false has buggy behaviour.
I agree, I kind of think this may be considered a bug? I suggest changing the category of this question to Bug Report and tagging it as a bug. An Epic Staff member may be able to help us both resolve this answer.
Because I’ve experienced this behavior on windows as well, but I cant’ help but think surely others have had this problem as well and yet I’ve not been able to find anything about it. I do know that 4.7 added some support for custom mouse but I’m not entirely sure what that was.
Also for your problem with the mouse position resetting… did you try storing the mouse X and Y position in a Vector2D restoring it when a click action happens?