From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/dce.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index d9c5f161385..5ec07b207d8 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -865,8 +865,12 @@ static void update_visible_region( struct dce *dce ) win = get_win_ptr( top_win ); if (win && win != WND_DESKTOP && win != WND_OTHER_PROCESS) { - surface = win->surface; - if (surface) window_surface_add_ref( surface ); + /* don't use a surface to paint the client area of Vulkan windows */ + if (list_empty( &win->vulkan_surfaces ) || (flags & DCX_WINDOW)) + { + surface = win->surface; + if (surface) window_surface_add_ref( surface ); + } release_win_ptr( win ); } }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/ntuser_private.h | 1 + dlls/win32u/vulkan.c | 16 ++++++++++++++++ dlls/win32u/window.c | 1 + 3 files changed, 18 insertions(+)
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 2f3bbdf91c0..e757f69b554 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -227,6 +227,7 @@ extern PFN_vkGetDeviceProcAddr p_vkGetDeviceProcAddr; extern PFN_vkGetInstanceProcAddr p_vkGetInstanceProcAddr;
extern BOOL vulkan_init(void); +extern void vulkan_update_surfaces( HWND hwnd ); extern void vulkan_detach_surfaces( struct list *surfaces );
/* window.c */ diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index c676ae10e54..a1985ca91fa 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -693,6 +693,22 @@ static void vulkan_init_once(void) vulkan_funcs.p_vkGetDeviceProcAddr = p_vkGetDeviceProcAddr; }
+void vulkan_update_surfaces( HWND hwnd ) +{ + struct surface *surface; + struct rb_entry *ptr; + + pthread_mutex_lock( &window_surfaces_lock ); + + if ((ptr = rb_get( &window_surfaces, hwnd ))) + { + surface = RB_ENTRY_VALUE( ptr, struct surface, window_entry ); + driver_funcs->p_vulkan_surface_update( surface->hwnd, surface->driver_private ); + } + + pthread_mutex_unlock( &window_surfaces_lock ); +} + void vulkan_detach_surfaces( struct list *surfaces ) { struct surface *surface, *next; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 4855555d926..203f44f0bb7 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -4601,6 +4601,7 @@ void update_window_state( HWND hwnd ) if (surface) window_surface_release( surface );
set_thread_dpi_awareness_context( context ); + vulkan_update_surfaces( hwnd ); }
/***********************************************************************
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/window.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 203f44f0bb7..9d305a8d9be 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -392,7 +392,7 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent ) RECT window_rect = {0}, old_screen_rect = {0}, new_screen_rect = {0}; UINT context; WINDOWPOS winpos; - HWND full_handle; + HWND full_handle, new_toplevel, old_toplevel; HWND old_parent = 0; BOOL was_visible; WND *win; @@ -463,6 +463,14 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent )
user_driver->pSetParent( full_handle, parent, old_parent );
+ new_toplevel = NtUserGetAncestor( parent, GA_ROOT ); + old_toplevel = NtUserGetAncestor( old_parent, GA_ROOT ); + if (new_toplevel != old_toplevel) + { + update_window_state( new_toplevel ); + update_window_state( old_toplevel ); + } + winpos.hwnd = hwnd; winpos.hwndInsertAfter = HWND_TOP; winpos.x = window_rect.left; @@ -5088,10 +5096,12 @@ LRESULT destroy_window( HWND hwnd ) struct window_surface *surface; HMENU menu = 0, sys_menu; WND *win; - HWND *children; + HWND toplevel, *children;
TRACE( "%p\n", hwnd );
+ toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + unregister_imm_window( hwnd );
/* free child windows */ @@ -5120,6 +5130,8 @@ LRESULT destroy_window( HWND hwnd )
send_message( hwnd, WM_NCDESTROY, 0, 0 );
+ if (toplevel && toplevel != hwnd) update_window_state( toplevel ); + /* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
/* free resources associated with the window */ @@ -5473,7 +5485,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, struct window_surface *surface; struct window_rects new_rects; CBT_CREATEWNDW cbtc; - HWND hwnd, owner = 0; + HWND hwnd, toplevel, owner = 0; CREATESTRUCTW cs; INT sw = SW_SHOW; RECT surface_rect; @@ -5767,6 +5779,10 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
TRACE( "created window %p\n", hwnd ); set_thread_dpi_awareness_context( context ); + + toplevel = NtUserGetAncestor( hwnd, GA_ROOT ); + if (toplevel && toplevel != hwnd) update_window_state( toplevel ); + return hwnd;
failed: