Giter Site home page Giter Site logo

Comments (15)

elmindreda avatar elmindreda commented on May 21, 2024

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.

jaredjones avatar jaredjones commented on May 21, 2024

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.

elmindreda avatar elmindreda commented on May 21, 2024

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.

jaredjones avatar jaredjones commented on May 21, 2024

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.

elmindreda avatar elmindreda commented on May 21, 2024

Another shot in the dark then; does dc58dd1 work any better?

from glfw.

nilium avatar nilium commented on May 21, 2024

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:

  1. 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.
  2. 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.

jaredjones avatar jaredjones commented on May 21, 2024

Nilium is this with commit dc58dd1 ?

from glfw.

nilium avatar nilium commented on May 21, 2024

Yes. I did write it, after all.

from glfw.

jaredjones avatar jaredjones commented on May 21, 2024

Ha, sorry didn't see that.

from glfw.

elmindreda avatar elmindreda commented on May 21, 2024

Unable to verify on OS X 10.8.3.

from glfw.

elmindreda avatar elmindreda commented on May 21, 2024

As I'm unable to reproduce this issue, unless I receive a patch for it, I'm moving it to 3.1.

from glfw.

Zenroth avatar Zenroth commented on May 21, 2024

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.

thk123 avatar thk123 commented on May 21, 2024

@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.

thk123 avatar thk123 commented on May 21, 2024

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.

elmindreda avatar elmindreda commented on May 21, 2024

This should be fixed with 546c794.

from glfw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.