On Mon Dec 2 22:29:18 2024 +0000, Robbert van der Helm wrote:
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?
There has been various changes in the way we handle window positioning, and it's now probably more flexible to arbitrary X11 parent windows, but in any case we still always consider the X root window coordinates as the origin for the Win32 desktop.
If you want to embed all Wine windows into another window and use its position as the Win32 desktop origin, it's basically what the "virtual desktop" mode is doing already. It's an option in winecfg, where we create a dedicated window for the Win32 desktop and every Wine window will be a child of it. You could probably then reparent the desktop window to the window you want?