On Mon Dec 2 10:04:22 2024 +0000, Rémi Bernon wrote:
`wm_state_serial` should be cleared when the window state actually changes and the `WM_STATE` PropertyNotify event is received, calling `window_wm_state_notify` which clears it.
Ah I completely missed the assignment there at the end when I was grepping for usages of `wm_state_serial`. I still can't reliably get Wine to accept configuration events I sent to it though. If I set the `WM_STATE` property it does process the next event, but then it gets stuck again after that because now `net_wm_state_serial` will be stuck on a nonzero value. I could probably figure out a way to get Wine to cooperate, but that's almost certainly going to break in a future Wine release.
To reiterate, my goal isn't necessarily to send `ConfigureNotify` events to Wine. I just want a Wine window that's reparented to another window to handle mouse events correctly, as otherwise Wine seems to interpret pointer events as being relative to the root window. So for example, if I have a regular top level X11 window at position 50x50 relative to the top left of the root window, and I reparent a Wine window into that window, clicking at coordinates 20x20 from the top left of the reparented Wine window will cause Wine to register a click at coordinate 70x70. Up until now it was possible to work around this by telling Wine about its location on screen through `ConfigureNotify` events, but that is of course a hack.
Since you've been working on Wine's X11 driver, what do you think is the best way to approach this in a way that isn't likely to break again in the future? Would extending Wine's existing tracking of reparented/embedded windows so any events related to pointer coordinates get translated accordingly make sense?