Code Monkey home page Code Monkey logo

Comments (14)

dapetcu21 avatar dapetcu21 commented on June 11, 2024 2

I booted up into Windows and apparently it's all fine. WM_MOUSELEAVE correctly only tracks the client area. Also tested hiding the mouse on_mouse_enter and showing it on_mouse_leave and it works beautifully on both Windows and macOS, allowing you to resize. I guess I'll close this, then.

from defos.

AGulev avatar AGulev commented on June 11, 2024 1

Hard week, I'll back to this issue after next week

from defos.

chaosddp avatar chaosddp commented on June 11, 2024

Then we have to provide a update method so that we are enble to do checking.
How about provide a method like is_mouse_exiting to developer, so that they can determine if they need to enable/disable the cursor by calling existing method.

from defos.

subsoap avatar subsoap commented on June 11, 2024

That's a good idea is_mouse_cursor_within_window maybe?

from defos.

subsoap avatar subsoap commented on June 11, 2024

I started Window support here

https://github.com/subsoap/defos/tree/is_mouse_cursor_within_window

@chaosddp could you test this? It seems a bit problematic and I'm not sure how to improve it.. The issue is that it's fast and good at detecting if the mouse cursor is well outside the window but seems buggy within sometimes constantly reporting true/false, and seems to have issues on the window edges.

@AGulev could you add Mac support? Is Mac support needed? It is on Windows because the cursor will hide still if the mouse is on the title/edges which makes resizing a pain.

from defos.

chaosddp avatar chaosddp commented on June 11, 2024

@subsoap I've tested on my Windows 10.

  1. the detect bound should exclude the titlebar, it seems like 32 pixel high?
  2. When i trying to move the cursor into the window, it was disappeared near the edge, but not exactly on the edge(red rectangle in following image), so still cannot resize the window easily. Maybe caused by window shadow effect?
    How about add a buffer to the detect bound, or make it as parameter to set the bound?

issue31

from defos.

subsoap avatar subsoap commented on June 11, 2024

@chaosddp If you move your mouse around inside the window does it consistently say it's within the client window or does it sometimes say it's outside of the client window sometimes even while inside?

from defos.

chaosddp avatar chaosddp commented on June 11, 2024

@subsoap only near the edge in the window, it will switch between in/outside for several time, then it will be stable if i do not move the mouse

from defos.

subsoap avatar subsoap commented on June 11, 2024

@chaosddp I think there may be a better approach that's possible for detecting mouse within client window with what we have available. I'll need to do some more reading and testing.

from defos.

subsoap avatar subsoap commented on June 11, 2024

@chaosddp I don't have progress on this yet, any ideas?

from defos.

chaosddp avatar chaosddp commented on June 11, 2024

@subsoap sorry so late, how about SetWindowLongPtr to hook the mouse in/out event, i have not try this on defold game yet.

from defos.

subsoap avatar subsoap commented on June 11, 2024

@chaosddp could you try that?

Another option is using GLFW functions directly #36

We've been warned to not use GLFW functions because they might remove them at any point but our main goal should be to make these features work so people can publish games and adapt over time if necessary.

from defos.

dapetcu21 avatar dapetcu21 commented on June 11, 2024

Oh. I haven't tested for that behavior on Windows. On macOS that's how it works because I added a tracking rectangle on the NSView, not the NSWindow, so the title bar should be considered outside the window.

I found this:
https://stackoverflow.com/questions/5629613/hide-cursor-in-client-rectangle-but-not-on-title-bar

Maybe changing the Windows code to use this instead of / in tandem with WM_LEAVE would help?

from defos.

dapetcu21 avatar dapetcu21 commented on June 11, 2024

I think I'll give it a go

from defos.

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.