Hello Guest

Ungrabbing mouse from debugger on linux?

  • 1 Replies
Ungrabbing mouse from debugger on linux?
« on: June 16, 2019, 20:27:37 »
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?


Offline spasi

  • *****
  • 2123
    • WebHotelier
Re: Ungrabbing mouse from debugger on linux?
« Reply #1 on: Today at 07:29:56 »
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?