This makes it possible to position client windows relative to their toplevel with the driver window rects only, without having to call into win32u to map window points. Updating the child window states whenever a window is moved will also let us to update the driver client-toplevel surface association in WindowPosChanged, for cases where the ancestor of a client surface is reparented.
-- v2: win32u: Pass all drivers window rects relative to the virtual screen. winex11: Handle ConfigureNotify for embedded window separately. win32u: Update children with a surface when the parent window moves. win32u: Lock the window when removing a vulkan surface from its list. win32u: Make sure vulkan windows have a pixel format selected. win32u: Pass window DPI rects in to MoveWindowBits. winemac: Remove MoveWindowBits driver entry.
From: Rémi Bernon rbernon@codeweavers.com
This is only called when surfaces are not used, which isn't the case on macOS. --- dlls/winemac.drv/gdi.c | 1 - dlls/winemac.drv/macdrv.h | 1 - dlls/winemac.drv/window.c | 76 --------------------------------------- 3 files changed, 78 deletions(-)
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 8492b0030c0..75059220187 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -306,7 +306,6 @@ static const struct user_driver_funcs macdrv_funcs = .pImeProcessKey = macdrv_ImeProcessKey, .pNotifyIMEStatus = macdrv_NotifyIMEStatus, .pWindowMessage = macdrv_WindowMessage, - .pMoveWindowBits = macdrv_MoveWindowBits, .pWindowPosChanged = macdrv_WindowPosChanged, .pWindowPosChanging = macdrv_WindowPosChanging, .pGetWindowStyleMasks = macdrv_GetWindowStyleMasks, diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index f9ada39d38a..3f14f1c0c19 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -155,7 +155,6 @@ extern void macdrv_SetLayeredWindowAttributes(HWND hwnd, COLORREF key, BYTE alph extern BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const struct window_rects *rects); extern BOOL macdrv_GetWindowStyleMasks(HWND hwnd, UINT style, UINT ex_style, UINT *style_mask, UINT *ex_style_mask); extern BOOL macdrv_CreateWindowSurface(HWND hwnd, BOOL layered, const RECT *surface_rect, struct window_surface **surface); -extern void macdrv_MoveWindowBits(HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects); extern void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface); extern void macdrv_DestroyCursorIcon(HCURSOR cursor); diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 824475a9b34..9cf02028eec 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1023,53 +1023,6 @@ static void sync_window_position(struct macdrv_win_data *data, UINT swp_flags, c }
-/*********************************************************************** - * move_window_bits - * - * Move the window bits when a window is moved. - */ -static void move_window_bits(HWND hwnd, macdrv_window window, const RECT *old_rect, const RECT *new_rect, - const RECT *old_client_rect, const RECT *new_client_rect, - const RECT *new_window_rect) -{ - RECT src_rect = *old_rect; - RECT dst_rect = *new_rect; - HDC hdc_src, hdc_dst; - HRGN rgn; - HWND parent = 0; - - if (!window) - { - OffsetRect(&dst_rect, -new_window_rect->left, -new_window_rect->top); - parent = NtUserGetAncestor(hwnd, GA_PARENT); - hdc_src = NtUserGetDCEx(parent, 0, DCX_CACHE); - hdc_dst = NtUserGetDCEx(hwnd, 0, DCX_CACHE | DCX_WINDOW); - } - else - { - OffsetRect(&dst_rect, -new_client_rect->left, -new_client_rect->top); - /* make src rect relative to the old position of the window */ - OffsetRect(&src_rect, -old_client_rect->left, -old_client_rect->top); - if (dst_rect.left == src_rect.left && dst_rect.top == src_rect.top) return; - hdc_src = hdc_dst = NtUserGetDCEx(hwnd, 0, DCX_CACHE); - } - - rgn = NtGdiCreateRectRgn(dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom); - NtGdiExtSelectClipRgn(hdc_dst, rgn, RGN_COPY); - NtGdiDeleteObjectApp(rgn); - NtUserExcludeUpdateRgn(hdc_dst, hwnd); - - TRACE("copying bits for win %p/%p %s -> %s\n", hwnd, window, - wine_dbgstr_rect(&src_rect), wine_dbgstr_rect(&dst_rect)); - NtGdiBitBlt(hdc_dst, dst_rect.left, dst_rect.top, - dst_rect.right - dst_rect.left, dst_rect.bottom - dst_rect.top, - hdc_src, src_rect.left, src_rect.top, SRCCOPY, 0, 0); - - NtUserReleaseDC(hwnd, hdc_dst); - if (hdc_src != hdc_dst) NtUserReleaseDC(parent, hdc_src); -} - - /********************************************************************** * activate_on_following_focus */ @@ -1761,35 +1714,6 @@ BOOL macdrv_WindowPosChanging(HWND hwnd, UINT swp_flags, BOOL shaped, const stru return ret; }
-/*********************************************************************** - * MoveWindowBits (MACDRV.@) - */ -void macdrv_MoveWindowBits(HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects) -{ - RECT old_visible_rect, old_client_rect; - struct macdrv_win_data *data; - macdrv_window window; - - if (!(data = get_win_data(hwnd))) return; - old_visible_rect = data->rects.visible; - old_client_rect = data->rects.client; - window = data->cocoa_window; - release_win_data(data); - - /* if all that happened is that the whole window moved, copy everything */ - if (EqualRect(&valid_rects[0], &new_rects->visible) && EqualRect(&valid_rects[1], &old_visible_rect)) - { - /* A Cocoa window's bits are moved automatically */ - if (!window && (valid_rects[0].left - valid_rects[1].left || valid_rects[0].top - valid_rects[1].top)) - move_window_bits(hwnd, 0, &old_visible_rect, &new_rects->visible, - &old_client_rect, &new_rects->client, &new_rects->window); - } - else - { - move_window_bits(hwnd, window, &valid_rects[1], &valid_rects[0], - &old_client_rect, &new_rects->client, &new_rects->window); - } -}
/*********************************************************************** * GetWindowStyleMasks (X11DRV.@)
From: Rémi Bernon rbernon@codeweavers.com
This is used to move pixels when drawing directly to the host window. In this case, the DC operations are all in window DPI, and DPI scaling isn't supported. --- dlls/win32u/driver.c | 3 ++- dlls/win32u/window.c | 6 +----- dlls/winex11.drv/window.c | 14 ++++++-------- dlls/winex11.drv/x11drv.h | 3 ++- include/wine/gdi_driver.h | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 3e094264d15..38132edd15a 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -896,7 +896,8 @@ static BOOL nulldrv_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *su return FALSE; }
-static void nulldrv_MoveWindowBits( HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects ) +static void nulldrv_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, + const struct window_rects *new_rects, const RECT *valid_rects ) { }
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ab58cabb40e..dc59ce1e9fd 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2101,11 +2101,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru if (surface_win && surface_win != hwnd) move_window_bits( hwnd, &new_rects->visible, &new_rects->visible, &new_rects->window, valid_rects ); else - { - rects[0] = map_dpi_rect( valid_rects[0], get_thread_dpi(), monitor_dpi ); - rects[1] = map_dpi_rect( valid_rects[1], get_thread_dpi(), monitor_dpi ); - user_driver->pMoveWindowBits( hwnd, &monitor_rects, rects ); - } + user_driver->pMoveWindowBits( hwnd, &old_rects, new_rects, valid_rects ); }
user_driver->pWindowPosChanged( hwnd, insert_after, swp_flags, &monitor_rects, get_driver_window_surface( new_surface, monitor_dpi ) ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 16dad0747a2..5faf3357625 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2524,30 +2524,28 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const str /*********************************************************************** * MoveWindowBits (X11DRV.@) */ -void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects ) +void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, + const struct window_rects *new_rects, const RECT *valid_rects ) { - RECT old_visible_rect, old_client_rect; struct x11drv_win_data *data; Window window;
if (!(data = get_win_data( hwnd ))) return; - old_visible_rect = data->rects.visible; - old_client_rect = data->rects.client; window = data->whole_window; release_win_data( data );
/* if all that happened is that the whole window moved, copy everything */ - if (EqualRect( &valid_rects[0], &new_rects->visible ) && EqualRect( &valid_rects[1], &old_visible_rect )) + if (EqualRect( &valid_rects[0], &new_rects->visible ) && EqualRect( &valid_rects[1], &old_rects->visible )) { /* if we have an X window the bits will be moved by the X server */ if (!window && (valid_rects[0].left - valid_rects[1].left || valid_rects[0].top - valid_rects[1].top)) - move_window_bits( hwnd, 0, &old_visible_rect, &new_rects->visible, - &old_client_rect, &new_rects->client, &new_rects->window ); + move_window_bits( hwnd, 0, &old_rects->visible, &new_rects->visible, + &old_rects->client, &new_rects->client, &new_rects->window ); } else { move_window_bits( hwnd, window, &valid_rects[1], &valid_rects[0], - &old_client_rect, &new_rects->client, &new_rects->window ); + &old_rects->client, &new_rects->client, &new_rects->window ); } }
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index a207db1c4a1..bb4c9caeb43 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -246,7 +246,8 @@ extern LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) extern BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const struct window_rects *rects ); extern BOOL X11DRV_GetWindowStyleMasks( HWND hwnd, UINT style, UINT ex_style, UINT *style_mask, UINT *ex_style_mask ); extern BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_rect, struct window_surface **surface ); -extern void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects ); +extern void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, + const struct window_rects *new_rects, const RECT *valid_rects ); extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface ); extern BOOL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index fee065af71b..78f7718b106 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -388,7 +388,7 @@ struct user_driver_funcs BOOL (*pWindowPosChanging)(HWND,UINT,BOOL,const struct window_rects *); BOOL (*pGetWindowStyleMasks)(HWND,UINT,UINT,UINT*,UINT*); BOOL (*pCreateWindowSurface)(HWND,BOOL,const RECT *,struct window_surface**); - void (*pMoveWindowBits)(HWND,const struct window_rects *,const RECT *); + void (*pMoveWindowBits)(HWND,const struct window_rects *,const struct window_rects *,const RECT *); void (*pWindowPosChanged)(HWND,HWND,UINT,const struct window_rects*,struct window_surface*); /* system parameters */ BOOL (*pSystemParametersInfo)(UINT,UINT,void*,UINT);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/ntuser_private.h | 1 + dlls/win32u/vulkan.c | 3 +++ dlls/win32u/window.c | 12 ++++++++++++ 3 files changed, 16 insertions(+)
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index fd594488c08..31e847f4537 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -262,5 +262,6 @@ static inline UINT win_get_flags( HWND hwnd ) WND *get_win_ptr( HWND hwnd ); BOOL is_child( HWND parent, HWND child ); BOOL is_window( HWND hwnd ); +BOOL window_has_pixel_format( HWND hwnd );
#endif /* __WINE_NTUSER_PRIVATE_H */ diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index d285b07b951..986d669ddb2 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -87,6 +87,9 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance instance, const VkWin return res; }
+ /* make sure the window has a pixel format selected to get consistent window surface updates */ + if (!window_has_pixel_format( info->hwnd )) win32u_set_window_pixel_format( info->hwnd, 1, TRUE ); + if (!(win = get_win_ptr( info->hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) list_init( &surface->entry ); else diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index dc59ce1e9fd..10ecf4b8c60 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1466,6 +1466,18 @@ BOOL win32u_set_window_pixel_format( HWND hwnd, int format, BOOL internal ) return TRUE; }
+int window_has_pixel_format( HWND hwnd ) +{ + WND *win = get_win_ptr( hwnd ); + BOOL ret; + + if (!win || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE; + ret = win->pixel_format || win->internal_pixel_format; + release_win_ptr( win ); + + return ret; +} + int win32u_get_window_pixel_format( HWND hwnd ) { WND *win = get_win_ptr( hwnd );
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/vulkan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 986d669ddb2..feaabd35f27 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -106,11 +106,17 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance instance, const VkWin static void win32u_vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR handle, const VkAllocationCallbacks *allocator ) { struct surface *surface = surface_from_handle( handle ); + WND *win;
TRACE( "instance %p, handle 0x%s, allocator %p\n", instance, wine_dbgstr_longlong(handle), allocator ); if (allocator) FIXME( "Support for allocation callbacks not implemented yet\n" );
- list_remove( &surface->entry ); + if ((win = get_win_ptr( surface->hwnd )) && win != WND_DESKTOP && win != WND_OTHER_PROCESS) + { + list_remove( &surface->entry ); + release_win_ptr( win ); + } + p_vkDestroySurfaceKHR( instance, surface->host_surface, NULL /* allocator */ ); driver_funcs->p_vulkan_surface_destroy( surface->hwnd, surface->driver_private ); free( surface );
From: Rémi Bernon rbernon@codeweavers.com
Since changes in a parent window state may affect the children state in the driver, ensure the driver gets a chance to update its internal state. --- dlls/win32u/window.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 10ecf4b8c60..ee532cb8459 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1974,6 +1974,22 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO return new_surface; }
+static void update_children_window_state( HWND hwnd ) +{ + HWND *children; + int i; + + if (!(children = list_window_children( 0, hwnd, NULL, 0 ))) return; + + for (i = 0; children[i]; i++) + { + if (!window_has_pixel_format( children[i] )) continue; + update_window_state( children[i] ); + } + + free( children ); +} + /*********************************************************************** * apply_window_pos * @@ -2117,6 +2133,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru }
user_driver->pWindowPosChanged( hwnd, insert_after, swp_flags, &monitor_rects, get_driver_window_surface( new_surface, monitor_dpi ) ); + update_children_window_state( hwnd ); }
return ret;
From: Rémi Bernon rbernon@codeweavers.com
These windows might have a (foreign) window parent, and we need to move them relatively to their parent. This uses XTranslateCoordinates to get relative positioning instead of NtUserMapWindowPoints. --- dlls/winex11.drv/event.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 9271758090e..38f0c05d3ac 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1029,11 +1029,10 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) { XConfigureEvent *event = &xev->xconfigure; struct x11drv_win_data *data; + Window child; RECT rect; POINT pos; UINT flags, dpi; - HWND parent; - BOOL root_coords; int cx, cy, x = event->x, y = event->y; DWORD style;
@@ -1051,30 +1050,29 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) goto done; }
- /* Get geometry */ - - dpi = get_win_monitor_dpi( data->hwnd ); - parent = NtUserGetAncestor( hwnd, GA_PARENT ); - root_coords = event->send_event; /* synthetic events are always in root coords */ - - if (!root_coords && parent == NtUserGetDesktopWindow()) /* normal event, map coordinates to the root */ + if (data->embedded || !data->whole_window) { - Window child; - XTranslateCoordinates( event->display, event->window, root_window, - 0, 0, &x, &y, &child ); - root_coords = TRUE; - } + Window parent = data->embedder ? data->embedder : root_window; + flags = SWP_NOACTIVATE | SWP_NOZORDER; + if (!data->whole_window) flags |= SWP_NOCOPYBITS; /* we can't copy bits of foreign windows */ + release_win_data( data );
- if (!root_coords) - { - pos.x = x; - pos.y = y; + XTranslateCoordinates( event->display, event->window, parent, 0, 0, (int *)&pos.x, (int *)&pos.y, &child ); + if (parent == root_window) pos = root_to_virtual_screen( pos.x, pos.y ); + set_window_pos( hwnd, 0, pos.x, pos.y, event->width, event->height, flags ); + return TRUE; } - else pos = root_to_virtual_screen( x, y ); + + /* Get geometry */ + + dpi = get_win_monitor_dpi( data->hwnd ); + /* synthetic events are always in root coords */ + if (!event->send_event) XTranslateCoordinates( event->display, event->window, root_window, + 0, 0, &x, &y, &child ); + pos = root_to_virtual_screen( x, y );
SetRect( &rect, pos.x, pos.y, pos.x + event->width, pos.y + event->height ); rect = window_rect_from_visible( &data->rects, rect ); - if (root_coords) NtUserMapWindowPoints( 0, parent, (POINT *)&rect, 2, 0 /* per-monitor DPI */ );
TRACE( "win %p/%lx new X rect %d,%d,%dx%d (event %d,%d,%dx%d)\n", hwnd, data->whole_window, (int)rect.left, (int)rect.top,
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/window.c | 9 ++++++++- dlls/wineandroid.drv/window.c | 2 +- dlls/winemac.drv/macdrv.h | 2 +- dlls/winewayland.drv/waylanddrv.h | 2 +- dlls/winex11.drv/x11drv.h | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ee532cb8459..f7009004bd1 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1927,6 +1927,10 @@ static struct window_surface *get_window_surface( HWND hwnd, UINT swp_flags, BOO
rects->visible = rects->window; monitor_rects = map_dpi_window_rects( *rects, get_thread_dpi(), monitor_dpi ); + map_window_points( parent, 0, (POINT *)&monitor_rects.window, 2, monitor_dpi ); + map_window_points( parent, 0, (POINT *)&monitor_rects.client, 2, monitor_dpi ); + map_window_points( parent, 0, (POINT *)&monitor_rects.visible, 2, monitor_dpi ); + if (!user_driver->pWindowPosChanging( hwnd, swp_flags, shaped, &monitor_rects )) needs_surface = FALSE; else if (is_child) needs_surface = FALSE; else if (swp_flags & SWP_HIDEWINDOW) needs_surface = FALSE; @@ -2000,7 +2004,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru { struct window_rects monitor_rects; WND *win; - HWND surface_win = 0; + HWND surface_win = 0, parent = NtUserGetAncestor( hwnd, GA_PARENT ); BOOL ret, is_layered, needs_update = FALSE; struct window_rects old_rects; RECT extra_rects[3]; @@ -2030,6 +2034,9 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru monitor_dpi = get_monitor_dpi( monitor );
monitor_rects = map_dpi_window_rects( *new_rects, get_thread_dpi(), monitor_dpi ); + map_window_points( parent, 0, (POINT *)&monitor_rects.window, 2, monitor_dpi ); + map_window_points( parent, 0, (POINT *)&monitor_rects.client, 2, monitor_dpi ); + map_window_points( parent, 0, (POINT *)&monitor_rects.visible, 2, monitor_dpi );
SERVER_START_REQ( set_window_pos ) { diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 537aae456e7..c131105e914 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -52,7 +52,7 @@ struct android_win_data { HWND hwnd; /* hwnd that this private data belongs to */ HWND parent; /* parent hwnd for child windows */ - struct window_rects rects; /* window rects in monitor DPI, relative to parent client area */ + struct window_rects rects; /* window rects in monitor DPI, relative to virtual screen */ ANativeWindow *window; /* native window wrapper that forwards calls to the desktop process */ };
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 3f14f1c0c19..4c0ee79440f 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -185,7 +185,7 @@ extern BOOL macdrv_SystemParametersInfo(UINT action, UINT int_param, void *ptr_p macdrv_window cocoa_window; macdrv_view cocoa_view; macdrv_view client_cocoa_view; - struct window_rects rects; /* window rects in monitor DPI, relative to parent client area */ + struct window_rects rects; /* window rects in monitor DPI, relative to virtual screen */ int pixel_format; /* pixel format for GL */ HANDLE drag_event; /* event to signal that Cocoa-driven window dragging has ended */ unsigned int on_screen : 1; /* is window ordered in? (minimized or not) */ diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index 9de42758aa1..4f9d43015d0 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -284,7 +284,7 @@ struct wayland_win_data struct wayland_surface *wayland_surface; /* wayland client surface (if any) for this window */ struct wayland_client_surface *client_surface; - /* window rects, relative to parent client area */ + /* window rects, relative to virtual screen */ struct window_rects rects; BOOL managed; }; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index bb4c9caeb43..562d695038f 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -601,7 +601,7 @@ struct x11drv_win_data HWND hwnd; /* hwnd that this private data belongs to */ Window whole_window; /* X window for the complete window */ Window client_window; /* X window for the client area */ - struct window_rects rects; /* window rects in monitor DPI, relative to parent client area */ + struct window_rects rects; /* window rects in monitor DPI, relative to virtual screen */ XIC xic; /* X input context */ UINT managed : 1; /* is window managed? */ UINT mapped : 1; /* is window mapped? (in either normal or iconic state) */
Regarding foreign windows, we don't try to move them, so this should work from WindowPosChanged perspective, and I created a separate path in ConfigureNotify to handle them, and as they aren't decorated it's possible to compute their parent relative position from X coordinates only.
Hmm, actually it needs some tweaking for macOS GL child window positioning, I will make some changes.
It would be easier to have absolute positions but looks like macOS driver isn't ready for it. Let's forget about this for now, I'll find another way to make monitor DPI virtualization work.
This merge request was closed by Rémi Bernon.