Ungrabbing mouse from debugger on linux?

Started by Barteks2x, June 16, 2019, 20:27:37

Previous topic - Next topic

Barteks2x

On all the linux systems I used, when mouse cursor is hidden/grabbed by a program that froze (ie. because I set a breakpoint in it), it just won't ungrab is (unlike windows) unless I remember a set or arcane commands (and have a terminal running at that moment, or remember how to start one with only keyboard).

So what I did before in LWJGL2, was use "evaluate expression" option in my IDE, and ran "Mouse.setGrabbed(false)" in it.
The LWJGL3 equivalent of that appears to be "GLFW.glfwSetInputMode(windowId, GLFW.GLFW_CURSOR, GLFW.GLFW_CURSOR_NORMAL)".

Except that it just doesn't do anything when invoked from "evaluate expression". How can I do that in LWJGL3?

spasi

I cannot reproduce this. After calling glfwSetInputMode(windowHnd, GLFW_CURSOR, GLFW_CURSOR_NORMAL), either automatically when the breakpoint is triggered or manually using IntelliJ's Evaluate Expression, I get mouse input back.

Checked the sources of LWJGL2 & GLFW, afaict both delegate to the same platform call (XUngrabPointer). Have you verified that you're passing the correct window handle?