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.
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.
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?
mouse-move only gets called when the mouse position is within the elements bounds. mouse-move-global gets called whenever the mouse moves anywhere.
Ah, I see. Then mouse-move will work for me.
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