Skip to content

Fix macOS click-through for transparent shaped windows#4

Open
iman-zamani wants to merge 1 commit intotexus:masterfrom
iman-zamani:master
Open

Fix macOS click-through for transparent shaped windows#4
iman-zamani wants to merge 1 commit intotexus:masterfrom
iman-zamani:master

Conversation

@iman-zamani
Copy link
Contributor

Replaced static hit-testing with a dynamic 60Hz NSTimer that checks mouse position. It updates [NSWindow setIgnoresMouseEvents:] based on the image's alpha channel, allowing clicks to pass through transparent pixels to underlying applications.

Replaced static hit-testing with a dynamic 60Hz NSTimer that checks mouse position. It updates [NSWindow setIgnoresMouseEvents:] based on the image's alpha channel, allowing clicks to pass through transparent pixels to underlying applications.
@texus
Copy link
Owner

texus commented Feb 18, 2026

The goal of this project is to serve as a simple example. This change more than doubles the amount of code in Transparent.mm and makes it more complicated to follow.

If the existing code didn't allow mouse clicks to pass to the windows behind it, then I do consider your code to be useful. So maybe if you e.g. store your modified file as a Gist then this project can mention the limitation and link to that gist?

@iman-zamani
Copy link
Contributor Author

Fair point!
I've put the advanced version (with the click-through fix) in a Gist here for anyone who needs it:
https://gist.github.com/iman-zamani/519e241916aeaa0c26e9f4787884f5bf

Feel free to close this out. Thanks for the review!

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

Successfully merging this pull request may close these issues.

2 participants

Comments