membrane

oskarkv 2026-05-05T00:34:25.305189Z

Hi! I'm just wondering how mouse-enter-global events work. Does membrane keep track of where the mouse was previously? I checked the code a little bit but I couldn't find anything like that. I'm confused.

phronmophobic 2026-05-05T00:44:16.874209Z

It appears that it doesn't actually do anything, https://github.com/phronmophobic/membrane/blob/93835080c35b86409e6a9ef416ef0e3eae353ac6/src/membrane/skia.clj#L2323. In theory, this event could be provided by a particular windowing manager library and hooked up by a particular backend, but it doesn't seem like any of the backends currently support it. I created an issue https://github.com/phronmophobic/membrane/issues/82 to follow up on it at some point. It's not currently a priority, but I can take a look if you have a particular use case in mind.

oskarkv 2026-05-05T00:51:06.710739Z

I'm making a game in WebGPU, and have made my own backend. I want to be able to hover over things to bring up tooltips. I guess I can just use mouse-move instead. I'm assuming mouse-move triggers when I move the mouse over an element. But what is the difference between mouse-move and mouse-move-global?

phronmophobic 2026-05-05T00:59:20.776669Z

mouse-move only gets called when the mouse position is within the elements bounds. mouse-move-global gets called whenever the mouse moves anywhere.

oskarkv 2026-05-05T01:00:30.072699Z

Ah, I see. Then mouse-move will work for me.

👍 1
phronmophobic 2026-05-05T01:03:00.915379Z

you usually want to avoid mouse-move-global because it requires walking the whole view tree, but there are a few cases where it's useful https://github.com/phronmophobic/membrane/blob/93835080c35b86409e6a9ef416ef0e3eae353ac6/src/membrane/basic_components.cljc#L38