Module: wine Branch: master Commit: 05d727a935b9009f188cc74ca77e14afc44aef30 URL: https://gitlab.winehq.org/wine/wine/-/commit/05d727a935b9009f188cc74ca77e14a...
Author: Rémi Bernon rbernon@codeweavers.com Date: Sat Jun 15 21:09:37 2024 +0200
win32u: Update the layered surface attributes in apply_window_pos.
And after layered window creation in NtUserUpdateLayeredWindow.
---
dlls/win32u/dce.c | 2 -- dlls/win32u/window.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index aa6836e3440..4a672d6c519 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -479,8 +479,6 @@ W32KAPI void window_surface_set_layered( struct window_surface *surface, COLORRE } } window_surface_unlock( surface ); - - window_surface_flush( surface ); }
W32KAPI void window_surface_set_clip( struct window_surface *surface, HRGN clip_region ) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index c860be38c65..83fa6d6e67c 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1873,6 +1873,18 @@ static struct window_surface *create_window_surface( HWND hwnd, UINT swp_flags, create_offscreen_window_surface( hwnd, surface_rect, &new_surface ); }
+ if (new_surface && !is_layered) + { + DWORD lwa_flags = 0; + COLORREF key; + BYTE alpha; + + if (!NtUserGetLayeredWindowAttributes( hwnd, &key, &alpha, &lwa_flags )) lwa_flags = 0; + if (!(lwa_flags & LWA_ALPHA)) alpha = 255; + if (!(lwa_flags & LWA_COLORKEY)) key = CLR_INVALID; + window_surface_set_layered( new_surface, key, alpha << 24, 0 ); + } + return new_surface; }
@@ -2248,6 +2260,8 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_
NtGdiDeleteObjectApp( hdc ); window_surface_unlock( surface ); + + window_surface_set_layered( surface, key, -1, 0xff000000 ); window_surface_flush( surface );
user_driver->pUpdateLayeredWindow( hwnd, &window_rect, key, alpha, flags );