Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor isn't restored when breakpoint is hit #530

Closed
DavidDanielsson opened this issue Jun 10, 2015 · 4 comments
Closed

Cursor isn't restored when breakpoint is hit #530

DavidDanielsson opened this issue Jun 10, 2015 · 4 comments
Assignees
Milestone

Comments

@DavidDanielsson
Copy link

I'm running Ubuntu 14.04.02 LTS and using CLion.

I disable the cursor using glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED) when the program is started, and when I hit a breakpoint the cursor mode isn't set back to normal. This of course makes it impossible to debug. I'm assuming this is a bug since it gives me the cursor back whenever I alt+tab.

I also noticed that if I put

if(focus)
    glfwSetInputMode(DLib::Input::GetListenWindow(), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
else
    glfwSetInputMode(DLib::Input::GetListenWindow(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);

in my focus callback the cursor remains disabled even if I alt+tab. Is this a bug or something I just don't know about?

@elmindreda
Copy link
Member

If the program hit a breakpoint then by definition execution has stopped, so how would GLFW re-enable the cursor?

@DavidDanielsson
Copy link
Author

Oh wow, that's embarrassing... Now I feel stupid...

I got so hung up on the problem with my focus callback that I got it into my head that the focus callback would be called when I hit a breakpoint.

@elmindreda
Copy link
Member

No worries, it happens to us all.

If you replace the body of disableCursor for your platform with that of hideCursor and recompile GLFW, you should be able to use the mouse during a breakpoint.

@elmindreda elmindreda self-assigned this Jun 11, 2015
@elmindreda elmindreda added question Please use the support label instead X11 labels Jun 11, 2015
@DavidDanielsson
Copy link
Author

Alright, thank you for the tip!

@elmindreda elmindreda added this to the milestone Jun 11, 2015
@elmindreda elmindreda added support and removed question Please use the support label instead labels Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants