Comments (15)
How many windows are you using? I can reproduce that on OS X 10.7.5 only by using more than one window. Edit: grammar fix.
from glfw.
I am using only one monitor, you can remote on here with Teamviewer or LogMeIn if you want to look at it.
EDIT: I am using only one window.
from glfw.
Well, this is embarrassing. I'd apparently forgotten to push half of the work I did on cursor modes on OS X. Does current master
work better on your machine?
from glfw.
Nope, same issues happen. When I use CAPTURED the mouse gets shot to the center of the window but is still visible. When I use hidden nothing happens. Hidden is doing the exact same thing as normal.
I also am positive I am using the latest master. I've pulled, merged... Checked the source for your updates. Cleaned. Rebuilt. Make Installed. Cleaned my Project, Recompiled.
from glfw.
Another shot in the dark then; does dc58dd1 work any better?
from glfw.
So, I can't reproduce anything for HIDDEN (works fine with one or more windows), though I also don't have more than OS X 10.8.3 to test on, so there's not a lot I can do there. As for CAPTURED, it is supposed to put the cursor in the middle of the window, and this is mostly for two reasons:
- The way cursor hiding works is it requires the cursor to be within the view frame. This isn't really ideal, but it beats trying to manage the retain count for NSCursor's hide/unhide calls.
- While the cursor is captured, it shouldn't be able to move. However, if you ⌘⇥ back into the application and the cursor isn't already inside the window, you'll have two problems: the cursor will remain visible and any mouse click will cause the window to lose focus/no longer be key. The second of those is the bigger problem, hence why the cursor had to be moved inside the window for CAPTURED mode (unless there's a way to tell OS X's window manager to stop taking over mouse input).
That said, if the cursor is visible inside the window while captured or you're still able to move it (or both), then something very strange is going on. My best guess right now is simply that the various versions of OS X handle cursor rects and such differently, though I can't imagine why that would be. Either way, it's difficult for me to pinpoint.
So, I've got no idea what's going on right now.
from glfw.
Nilium is this with commit dc58dd1 ?
from glfw.
Yes. I did write it, after all.
from glfw.
Ha, sorry didn't see that.
from glfw.
Unable to verify on OS X 10.8.3.
from glfw.
As I'm unable to reproduce this issue, unless I receive a patch for it, I'm moving it to 3.1.
from glfw.
I'm perhaps running into something similar. When switching to fullscreen I also issue:
glfwSetInputMode( window,GLFW_CURSOR,GLFW_CURSOR_NORMAL );
Yet the cursor does not become visible.
Likewise when I then destroy the window, and create a new window to switch back to windows mode, my cursor is also not visible until I invisibly mouse over to the Dock a which point it becomes visible. This step also has a call to glfwSetInputMode( window,GLFW_CURSOR,GLFW_CURSOR_NORMAL );
In my case GLWF_CURSOR_HIDDEN seems to work as expected, its just the NORMAL mode that seems to fail to work.
from glfw.
@Zenroth I am having the same problem, setting back to normal mode does not reshow the mouse. I was digging about in cocoa_window.m (and excuse me if what I say is dumb, completely new to objective-c & OSX dev) and was looking at _glfwPlatformSetCursorMode
. Could someone enlighten me on what the [window->ns.object disableCursorRects];
does. I couldn't seem to find any (helpful) resource on it online.
Anyway, I added the following code:
CGDisplayShowCursor(kCGDirectMainDisplay);
In the GLFW_CURSOR_NORMAL
case (and a hide call in both the other cases). Since I assumed that enable/disable cursor rects was meant to be doing something similar, I removed them. This worked!
If I added back the Cursor rect stuff it broke again (the cursor did not reappear). As I said, I don't know enough about what the Cursor rect stuff means to offer any suggestion/fix but hopefully this will help someone.
from glfw.
Update: Now know what they mean! And I see by removing them it causes the mouse to not reappear if invisible and you leave the window. I worked around this by manually detecting when the mouse left the window and showing/hiding correspondingly.
Further, with my "fix", if you went from Hidden->Bound->Visible then it would be hidden twice and only shown once so would stay invisible. I resolved this by the only hiding the cursor if coming from Normal mode.
So, all in all, while my fix works, is highly hacky and still doesn't answer the original question of why disabling the cursor rects doesn't re-show the cursor.
from glfw.
This should be fixed with 546c794.
from glfw.
Related Issues (20)
- GLFW Window is too big if wayland monitor is scaled HOT 6
- Add support for cross-platform fallback API to show a prerendered image
- Raise a window? HOT 1
- Getting the mouse position in screen coordinates? Why not framebuffer coordinates instead? HOT 2
- Compression of pending same-type events? HOT 1
- Support for _GLFW_X11 on MacOS with XQuartz HOT 2
- Viewport Position after Resize HOT 4
- glfwSetKeyCallback Documentation Appears to be Incorrect HOT 1
- Segfault on thread destruction with Wayland but not X11. HOT 7
- Input Not Getting Picked up HOT 4
- Compilation issues manylinux HOT 3
- Remove support for the original MinGW distribution
- Update the minimum CMake version to 3.16
- Question: Potential issue with error mutex? HOT 1
- Can't link glfw application on mac HOT 9
- Likely memory leaks HOT 1
- allow creation on remote (X11) displays
- glfwWindowHint(GLFW_DOUBLEBUFFER, GL_FALSE); on Ubuntu22.04.4's libnvidia-egl-wayland1
- Documentation doesn't fully specify the expected GLFWreallocatefun behavior
- compile error version 3.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glfw.