On Sun Dec 1 18:46:02 2024 +0000, Robbert van der Helm wrote:
> Hi!
> This specific check causes `ConfigureNotify` events to no longer be
> processed by top level windows (i.e. managed) windows. as
> `wm_state_serial` will be set but never cleared again. For the last
> couple years I've been sending `ConfigureNotify` events to a reparented
> window to embed Wine windows into other X11 windows, but this specific
> check breaks that for Wine 9.22. Wine's XEmbed support (which never
> worked quite as well as the reparent+`ConfigureNotify` approach) also
> does not seem to work anymore with recent Wine releases.
> My question is: is this check necessary to prevent other undesirable
> interactions and if so, what's the current best way to send X11 window
> configuration events to Wine windows?
> More context: https://github.com/robbert-vdh/yabridge/issues/382#issuecomment-2510155844
Hi, I don't think this checks does what you describe.
This specific `if` is there for *unmanaged* windows, which are X override-redirect windows which are fully under Wine control, and which won't receive WM_STATE property changes. We clear the `wm_state_serial` for them, in order to allow sending more window state changes without waiting, as well as window configure requests. That if doesn't set wm_state_serial, it clears it, and it shouldn't prevent the `ConfigureNotify` to be processed, rather the other way around.
For *managed* windows, when Wine requests a window state change, the Window Manager is supposed to change the `WM_STATE` property accordingly once it is done, and we should then receive the corresponding `PropertyNotify` event. We still process `ConfigureNotify` events, but we don't apply them to the Win32 state until all the requested changes have been processed.
If the `WM_STATE` property isn't modified or isn't present, then yes the Win32 state will appear to be stuck forever. This is however a bug in the window manager, according to the ICCCM, and we can really only support ICCCM-compatible window manager (or just uncheck "allow the window manager to manage the windows" in `winecfg`).
In any case, `ConfigureNotify` events are always processed, and applied to the Win32 state when there's no reason to wait. XEMBED support may be what makes a difference here, as we used only for systray embedded windows. I don't think any other use case was very intended before or well supported, and there's assumptions being made that embedded windows are always systray windows
It's probably possible to support it better, and maybe even easier to do so now that we track X parent and embedder windows without leaking them into the Win32 space anymore. If there's a regression, please open a bug on bugs.winehq.org, describe your use case with reproducible steps, and we will try to fix it.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569#note_89382
Robbert van der Helm (@robbert-vdh) commented about dlls/winex11.drv/window.c:
> if (!data->embedded) XIconifyWindow( data->display, data->whole_window, data->vis.screen );
> break;
> }
> +
> + /* override redirect windows won't receive WM_STATE property changes */
> + if (!data->managed) data->wm_state_serial = 0;
Hi!
This specific check causes `ConfigureNotify` events to no longer be processed by top level windows (i.e. managed) windows. as `wm_state_serial` will be set but never cleared again. For the last couple years I've been sending `ConfigureNotify` events to a reparented window to embed Wine windows into other X11 windows, but this specific check breaks that for Wine 9.22. Wine's XEmbed support (which never worked quite as well as the reparent+`ConfigureNotify` approach) also does not seem to work anymore with recent Wine releases.
My question is: is this check necessary to prevent other undesirable interactions and if so, what's the current best way to send X11 window configuration events to Wine windows?
More context: https://github.com/robbert-vdh/yabridge/issues/382#issuecomment-2510155844
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569#note_89380
The idea is to use common helper to convert between CP_ACP and WCHAR strings first. Later all functions will be switched to support UTF-8 at the same time.
--
v2: msvcrt: Call _wfullpath in _fullpath function.
msvcrt: Call _wgetdcwd in _getdcwd function.
msvcrt: Call _wgetcwd in _getcwd function.
msvcrt: Call _wchdir in _chdir function.
msvcrt: Call _wrmdir in _rmdir function.
msvcrt: Call _wmkdir in _mkdir function.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6937
The idea is to use common helper to convert between CP_ACP and WCHAR strings first. Later all functions will be switched to support UTF-8 at the same time.
--
v3: msvcrt: Call _wfullpath in _fullpath function.
msvcrt: Call _wgetdcwd in _getdcwd function.
msvcrt: Call _wgetcwd in _getcwd function.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6937
Recent changes allowed the Wayland driver to properly deal with numpad keys depending on numlock status. This MR ensures that numlock and other lock state is properly synced, and concludes the fix for https://bugs.winehq.org/show_bug.cgi?id=56397.
This MR also syncs the key press state when a window gains keyboard focus, including any modifier press state. Note that we currently ignore the modifier press information from the `modifier` event, since: 1. it doesn't differentiate between left-right keys, 2. mod press state changes will be normally preceded by a matching key event, so we are able to sync properly. However, if we find that we need to handle mod press state changes without corresponding key events, we will need to implement some sensible way to sync these, too.
Although I would like for the driver work exclusively in terms of scancodes, I still needed to use vkeys in this case, since this is how wineserver expresses keyboard state at the moment. This means that I had to introduce/duplicate some extra scan->vkey logic in the driver (e.g., numpad keys based on numlock state) to get things right.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5712