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

v3.4 and supporting GLFW_MOUSE_PASSTHROUGH #375

Open
J7mbo opened this issue Mar 30, 2023 · 7 comments
Open

v3.4 and supporting GLFW_MOUSE_PASSTHROUGH #375

J7mbo opened this issue Mar 30, 2023 · 7 comments

Comments

@J7mbo
Copy link

J7mbo commented Mar 30, 2023

Hi folks! I'm displaying a transparent window overlay to highlight things on the screen (a red rectangle) and I'd really like to be able to "still click through" to things underneath this rectangle. I found that glfw itself has: GLFW_MOUSE_PASSTHROUGH from 2020 I think. I couldn't find this in the code in here, so I assume it's not implemented yet.

Would it be possible to add this without too much effort? If it's just a redirect from to a C function or something, I'd be happy to learn and follow the pattern you do for other calls, but I may need support on knowing exactly what to do.

Please let me know what you think and if you'd be willing to support this?

@J7mbo
Copy link
Author

J7mbo commented Mar 30, 2023

It looks like this is only for v3.4. So I guess my request is actually about supporting version v3.4. I'll change the title of the issue.

@J7mbo J7mbo changed the title Support GLFW_MOUSE_PASSTHROUGH? v3.4 and supporting GLFW_MOUSE_PASSTHROUGH Mar 30, 2023
@J7mbo
Copy link
Author

J7mbo commented Mar 30, 2023

Additionally, it's probable that supporting an entirely new version would be a tonne of work and it's not fair for me to request this just for a single window hint.

However would a maintainer / supporter be willing to suggest or advise here were I to attempt to do this myself, just for a single window hint, by following the patterns set by this library for the other versions?

Maybe the PR could even begin the work for supporting v3.4 and if it's not complicated I could contribute with the rest if it's just "passthrough" function calls. :)

@J7mbo
Copy link
Author

J7mbo commented Apr 5, 2023

Closing as it looks like this isn't interesting for anyone. I'll figure out another way.

@J7mbo J7mbo closed this as completed Apr 5, 2023
@J7mbo
Copy link
Author

J7mbo commented May 12, 2024

Looks this this issue will solve this.

@DownloadableFox
Copy link

Sorry if I shouldn't be typing here considering it's closed, I tried to reach you out on Twitter but it seems you don't have DMs enabled. I have been experiencing the same issue with a personal project that I have pause whilst waiting for the release of GLFW 3.4. I was looking to use the GLFW_MOUSE_PASSTHROUGH but of course, it is not yet available.

I was wondering if you have found any alternative to this so far?

@J7mbo
Copy link
Author

J7mbo commented May 18, 2024

Hey @DownloadableFox, nope not found anything else yet. Just waiting for this MR. There's no instructions there that I can see yet as I'm on a Mac.

I'll re-open as it's being actively worked on.

@J7mbo J7mbo reopened this May 18, 2024
@J7mbo
Copy link
Author

J7mbo commented May 18, 2024

Okay I got this working.

I checked out Geo25ray's master branch which has 3.4 changes in.

Then in testdata/customcursor/main.go I commented out the line window.SetIcon(), because this wasn't working on Mac. Maybe it works for you if you're not using a Mac.

Then in the Hints area at the top of window.go, directly under floating, I added the new hint:

MousePassthrough Hint = C.GLFW_MOUSE_PASSTHROUGH

Finally in customcursor/main.go I added:

window.SetAttrib(glfw.MousePassthrough, 1)
window.SetAttrib(glfw.Floating, 1)

And mouse pass through worked! :)

@Geo25rey Geo25rey mentioned this issue May 18, 2024
43 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants