From: Paul Gofman pgofman@codeweavers.com
--- dlls/winex11.drv/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7ae1d8ef66a..e41a28f149a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2110,7 +2110,7 @@ static void create_whole_window( struct x11drv_win_data *data ) HRGN win_rgn; POINT pos;
- if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window )) + if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.visible )) { TRACE( "making win %p/%lx managed\n", data->hwnd, data->whole_window ); data->managed = TRUE; @@ -2876,7 +2876,7 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const str data->shaped = shaped;
/* check if we need to switch the window to managed */ - if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, &rects->window )) + if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, &rects->visible )) { TRACE( "making win %p/%lx managed\n", hwnd, data->whole_window ); release_win_data( data );
From: Paul Gofman pgofman@codeweavers.com
--- dlls/winex11.drv/window.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e41a28f149a..9b565efb243 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2883,6 +2883,7 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const str unmap_window( hwnd ); if (!(data = get_win_data( hwnd ))) return FALSE; /* use default surface */ data->managed = TRUE; + sync_window_style( data ); }
ret = !!data->whole_window; /* use default surface if we don't have a window */
WRT patch 1, a fullscreen window is supposed to become manage. It doesn't currently happen with emulated mode when the emulated window rect is less than native mode fullscreen. So the window stays unmanaged, in this state it is on top of everything and is impossible to switch out (override_redirect window attribute is responsible for that).
WRT patch 2, sync_window_style() is needed to change override_redirect window attribute after window is made manage. It will be called in the course of unmapping and conseqeunt window mapping sequence, but the state transitions happening before that are broken with override_redirect not reset, the (absent) expected states on the way are absent.
Rémi Bernon (@rbernon) commented about dlls/winex11.drv/window.c:
HRGN win_rgn; POINT pos;
- if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.window ))
- if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->rects.visible ))
Looks like this isn't correct either: `is_window_managed` calls `NtUserGetMonitorInfo` which returns the monitor rect in thread DPI (which can be anything but raw DPI), and compares against driver rects which are in raw DPI. I initially had moved `is_window_managed` to win32u, to avoid that problem but it ended up not being accepted and I forgot to fix it differently.
On Wed Feb 19 12:37:28 2025 +0000, Rémi Bernon wrote:
Looks like this isn't correct either: `is_window_managed` calls `NtUserGetMonitorInfo` which returns the monitor rect in thread DPI (which can be anything but raw DPI), and compares against driver rects which are in raw DPI. I initially had moved `is_window_managed` to win32u, to avoid that problem but it ended up not being accepted and I forgot to fix it differently.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7370 would be a better way to fix this I think (and in the direction of getting rid of WindowPosChanging callback).
Interestingly enough, this change doesn't fix the problem for me.
Superseded with !7370
This merge request was closed by Rémi Bernon.