Closed Tomas-M closed 6 years ago
Hm, is there no simpler way? I was thinking to get x/y mouse coordinates on some other event, like expose, or window init, or focus or something (I really do not know). so we can get it directly in the message. Does xmotion.x and xmotion.y exist in any other scope than button press/release or motionnotify?
No, only mouse events offer the mouse position fields. So without a mouse event we need to poll for it instead with something like what I linked. This is pretty useful though.
I've resolved this by fd073ec5743969d77d30c657ca302acf4b12bc94 Basically what was needed is to listen for EnterNotify event, which also contains x/y coordinates, and is received by the window as soon as mouse enters it. This event is fired when the window is mapped too, so it perfectly does just what we want.
Oh, that event also fires when the window is mapped? Cool!
To be really honest I'm not entirely sure if the mapping is the correct particular action which causes the event to fire, that was just my guess, to make it clear :) but it is fired when xlunch starts, so something fires it and the resulting behavior is exactly what I need :-)
If I start xlunch, and mouse cursor happens to be over an item, it does not higlight the item unless I move my mouse slightly. I know there is an event handling for mouse move, but can we know mouse cursor coordinates even without moving the mouse, so xlunch selects the right item under cursor upon start, without the need to move mouse?