From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/window.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ad4d49ca034..7edbbba29bb 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1832,10 +1832,11 @@ static BOOL get_default_window_surface( HWND hwnd, const RECT *surface_rect, str return TRUE; }
-static struct window_surface *create_window_surface( HWND hwnd, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, +static struct window_surface *create_window_surface( HWND hwnd, UINT swp_flags, BOOL create_layered, + const RECT *window_rect, const RECT *client_rect, RECT *visible_rect, RECT *surface_rect ) { - BOOL shaped, needs_surface, layered, ulw_layered = FALSE; + BOOL shaped, needs_surface, create_opaque, is_layered; struct window_surface *new_surface; RECT dummy; HRGN shape; @@ -1852,14 +1853,21 @@ static struct window_surface *create_window_surface( HWND hwnd, UINT swp_flags, if (!get_surface_rect( visible_rect, surface_rect )) needs_surface = FALSE; if (!get_default_window_surface( hwnd, surface_rect, &new_surface )) return NULL;
+ is_layered = new_surface && new_surface->alpha_mask; + create_opaque = !(get_window_long( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED); + + if ((create_opaque && is_layered) || (create_layered && !is_layered)) + { + window_surface_release( new_surface ); + new_surface = &dummy_surface; + window_surface_add_ref( new_surface ); + } + if (!needs_surface || IsRectEmpty( visible_rect )) needs_surface = FALSE; /* use default surface */ else needs_surface = !user_driver->pCreateWindowSurface( hwnd, surface_rect, &new_surface );
- if ((layered = !!(get_window_long( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED))) - ulw_layered = !NtUserGetLayeredWindowAttributes( hwnd, NULL, NULL, NULL ); - /* create or update window surface for top-level windows if the driver doesn't implement CreateWindowSurface */ - if (needs_surface && new_surface == &dummy_surface && (!layered || !ulw_layered)) + if (needs_surface && new_surface == &dummy_surface && (create_opaque && !create_layered)) { window_surface_release( new_surface ); create_offscreen_window_surface( hwnd, surface_rect, &new_surface ); @@ -2203,7 +2211,7 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_ TRACE( "window %p win %s client %s\n", hwnd, wine_dbgstr_rect(&window_rect), wine_dbgstr_rect(&client_rect) );
- surface = create_window_surface( hwnd, swp_flags, &window_rect, &client_rect, &visible_rect, &surface_rect ); + surface = create_window_surface( hwnd, swp_flags, TRUE, &window_rect, &client_rect, &visible_rect, &surface_rect ); apply_window_pos( hwnd, 0, swp_flags, surface, &window_rect, &client_rect, &visible_rect, NULL ); if (surface) window_surface_release( surface );
@@ -3521,7 +3529,7 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) calc_ncsize( winpos, &old_window_rect, &old_client_rect, &new_window_rect, &new_client_rect, valid_rects, parent_x, parent_y );
- surface = create_window_surface( winpos->hwnd, winpos->flags, &new_window_rect, &new_client_rect, + surface = create_window_surface( winpos->hwnd, winpos->flags, FALSE, &new_window_rect, &new_client_rect, &visible_rect, &surface_rect ); if (!apply_window_pos( winpos->hwnd, winpos->hwndInsertAfter, winpos->flags, surface, &new_window_rect, &new_client_rect, &visible_rect, valid_rects )) @@ -4320,7 +4328,7 @@ void update_window_state( HWND hwnd ) get_window_rects( hwnd, COORDS_PARENT, &window_rect, &client_rect, get_thread_dpi() ); valid_rects[0] = valid_rects[1] = client_rect;
- surface = create_window_surface( hwnd, swp_flags, &window_rect, &client_rect, &visible_rect, &surface_rect ); + surface = create_window_surface( hwnd, swp_flags, FALSE, &window_rect, &client_rect, &visible_rect, &surface_rect ); apply_window_pos( hwnd, 0, swp_flags, surface, &window_rect, &client_rect, &visible_rect, valid_rects ); if (surface) window_surface_release( surface );
@@ -5364,7 +5372,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, if (cs.x > 0x7fffffff - cx) rect.right = 0x7fffffff; if (cs.y > 0x7fffffff - cy) rect.bottom = 0x7fffffff;
- surface = create_window_surface( hwnd, SWP_NOZORDER | SWP_NOACTIVATE, &rect, &rect, &visible_rect, &surface_rect ); + surface = create_window_surface( hwnd, SWP_NOZORDER | SWP_NOACTIVATE, FALSE, &rect, &rect, &visible_rect, &surface_rect ); if (!apply_window_pos( hwnd, 0, SWP_NOZORDER | SWP_NOACTIVATE, surface, &rect, &rect, &visible_rect, NULL )) { if (surface) window_surface_release( surface ); @@ -5403,7 +5411,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, send_message( hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&client_rect ); map_window_points( 0, parent, (POINT *)&client_rect, 2, win_dpi );
- surface = create_window_surface( hwnd, SWP_NOACTIVATE, &rect, &client_rect, &visible_rect, &surface_rect ); + surface = create_window_surface( hwnd, SWP_NOACTIVATE, FALSE, &rect, &client_rect, &visible_rect, &surface_rect ); apply_window_pos( hwnd, insert_after, SWP_NOACTIVATE, surface, &rect, &client_rect, &visible_rect, NULL ); if (surface) window_surface_release( surface ); }
From: Rémi Bernon rbernon@codeweavers.com
In order for apply_window_pos to be called and surface to be updated. --- dlls/win32u/window.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 7edbbba29bb..c860be38c65 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1202,7 +1202,7 @@ static HWND set_window_owner( HWND hwnd, HWND owner ) /* Helper function for SetWindowLong(). */ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOOL ansi ) { - BOOL ok, made_visible = FALSE; + BOOL ok, made_visible = FALSE, layered = TRUE; LONG_PTR retval = 0; STYLESTRUCT style; WND *win; @@ -1389,8 +1389,8 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO } SERVER_END_REQ;
- if ((offset == GWL_STYLE && ((style.styleOld ^ style.styleNew) & WS_VISIBLE)) || - (offset == GWL_EXSTYLE && ((style.styleOld ^ style.styleNew) & WS_EX_LAYERED))) + if (offset == GWL_EXSTYLE && ((style.styleOld ^ style.styleNew) & WS_EX_LAYERED)) layered = TRUE; + if ((offset == GWL_STYLE && ((style.styleOld ^ style.styleNew) & WS_VISIBLE)) || layered) { made_visible = (win->dwStyle & WS_VISIBLE) != 0; invalidate_dce( win, NULL ); @@ -1404,7 +1404,7 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO style.styleOld = retval; style.styleNew = newval; user_driver->pSetWindowStyle( hwnd, offset, &style ); - if (made_visible) update_window_state( hwnd ); + if (made_visible || layered) update_window_state( hwnd ); send_message( hwnd, WM_STYLECHANGED, offset, (LPARAM)&style ); }
From: Rémi Bernon rbernon@codeweavers.com
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 );
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/bitblt.c | 16 +++------------- dlls/winex11.drv/window.c | 14 +++++--------- 2 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 5c08c1a2120..780b565b744 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1882,7 +1882,7 @@ static const struct window_surface_funcs x11drv_surface_funcs = * create_surface */ static struct window_surface *create_surface( HWND hwnd, Window window, const XVisualInfo *vis, const RECT *rect, - COLORREF color_key, BOOL use_alpha ) + BOOL use_alpha ) { const XPixmapFormatValues *format = pixmap_formats[vis->depth]; char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; @@ -1952,9 +1952,6 @@ static struct window_surface *create_surface( HWND hwnd, Window window, const XV
TRACE( "created %p for %lx %s image %p\n", surface, window, wine_dbgstr_rect(rect), surface->image->ximage->data );
- if (use_alpha) window_surface_set_layered( &surface->header, color_key, -1, 0xff000000 ); - else window_surface_set_layered( &surface->header, color_key, -1, 0 ); - return &surface->header;
failed: @@ -1995,8 +1992,6 @@ HRGN expose_surface( struct window_surface *window_surface, const RECT *rect ) BOOL X11DRV_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct window_surface **surface ) { struct x11drv_win_data *data; - DWORD flags; - COLORREF key; BOOL layered = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED;
TRACE( "hwnd %p, surface_rect %s, surface %p\n", hwnd, wine_dbgstr_rect( surface_rect ), surface ); @@ -2022,10 +2017,7 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct win } }
- if (!layered || !NtUserGetLayeredWindowAttributes( hwnd, &key, NULL, &flags ) || !(flags & LWA_COLORKEY)) - key = CLR_INVALID; - - *surface = create_surface( data->hwnd, data->whole_window, &data->vis, surface_rect, key, FALSE ); + *surface = create_surface( data->hwnd, data->whole_window, &data->vis, surface_rect, FALSE );
done: release_win_data( data ); @@ -2050,12 +2042,10 @@ BOOL X11DRV_CreateLayeredWindow( HWND hwnd, const RECT *surface_rect, COLORREF c surface = data->surface; if (!surface || !EqualRect( &surface->rect, surface_rect )) { - data->surface = create_surface( data->hwnd, data->whole_window, &data->vis, surface_rect, - color_key, data->use_alpha ); + data->surface = create_surface( data->hwnd, data->whole_window, &data->vis, surface_rect, data->use_alpha ); if (surface) window_surface_release( surface ); surface = data->surface; } - else window_surface_set_layered( surface, color_key, -1, 0xff000000 );
if ((*window_surface = surface)) window_surface_add_ref( surface ); release_win_data( data ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 9e51d76e5ab..5135355abfe 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -438,8 +438,7 @@ static void sync_window_region( struct x11drv_win_data *data, HRGN win_region ) /*********************************************************************** * sync_window_opacity */ -static void sync_window_opacity( Display *display, Window win, - COLORREF key, BYTE alpha, DWORD flags ) +static void sync_window_opacity( Display *display, Window win, BYTE alpha, DWORD flags ) { unsigned long opacity = 0xffffffff;
@@ -1794,7 +1793,7 @@ static void create_whole_window( struct x11drv_win_data *data )
/* set the window opacity */ if (!NtUserGetLayeredWindowAttributes( data->hwnd, &key, &alpha, &layered_flags )) layered_flags = 0; - sync_window_opacity( data->display, data->whole_window, key, alpha, layered_flags ); + sync_window_opacity( data->display, data->whole_window, alpha, layered_flags );
XFlush( data->display ); /* make sure the window exists before we start painting to it */
@@ -1919,8 +1918,7 @@ void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) { data->layered = FALSE; set_window_visual( data, &default_visual, FALSE ); - sync_window_opacity( data->display, data->whole_window, 0, 0, 0 ); - if (data->surface) window_surface_set_layered( data->surface, CLR_INVALID, -1, 0 ); + sync_window_opacity( data->display, data->whole_window, 0, 0 ); } done: release_win_data( data ); @@ -2896,9 +2894,7 @@ void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWO set_window_visual( data, &default_visual, FALSE );
if (data->whole_window) - sync_window_opacity( data->display, data->whole_window, key, alpha, flags ); - if (data->surface) - window_surface_set_layered( data->surface, (flags & LWA_COLORKEY) ? key : CLR_INVALID, alpha << 24, 0 ); + sync_window_opacity( data->display, data->whole_window, alpha, flags );
data->layered = TRUE; if (!data->mapped) /* mapping is delayed until attributes are set */ @@ -2920,7 +2916,7 @@ void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWO Window win = X11DRV_get_whole_window( hwnd ); if (win) { - sync_window_opacity( gdi_display, win, key, alpha, flags ); + sync_window_opacity( gdi_display, win, alpha, flags ); if (flags & LWA_COLORKEY) FIXME( "LWA_COLORKEY not supported on foreign process window %p\n", hwnd ); }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/wineandroid.drv/android.h | 2 - dlls/wineandroid.drv/init.c | 1 - dlls/wineandroid.drv/window.c | 69 +++++----------------------------- 3 files changed, 10 insertions(+), 62 deletions(-)
diff --git a/dlls/wineandroid.drv/android.h b/dlls/wineandroid.drv/android.h index 54062b04db0..9f6bb2b999c 100644 --- a/dlls/wineandroid.drv/android.h +++ b/dlls/wineandroid.drv/android.h @@ -92,8 +92,6 @@ extern BOOL ANDROID_CreateWindow( HWND hwnd ); extern void ANDROID_DestroyWindow( HWND hwnd ); extern BOOL ANDROID_ProcessEvents( DWORD mask ); extern LRESULT ANDROID_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ); -extern void ANDROID_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, - DWORD flags ); extern void ANDROID_SetParent( HWND hwnd, HWND parent, HWND old_parent ); extern void ANDROID_SetCapture( HWND hwnd, UINT flags ); extern void ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ); diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index 73fd28c7c69..25055ece395 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -344,7 +344,6 @@ static const struct user_driver_funcs android_drv_funcs = .pDestroyWindow = ANDROID_DestroyWindow, .pProcessEvents = ANDROID_ProcessEvents, .pSetCapture = ANDROID_SetCapture, - .pSetLayeredWindowAttributes = ANDROID_SetLayeredWindowAttributes, .pSetParent = ANDROID_SetParent, .pSetWindowStyle = ANDROID_SetWindowStyle, .pShowWindow = ANDROID_ShowWindow, diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 0f8cedfbd0b..553ed985fae 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -561,25 +561,6 @@ static struct android_window_surface *get_android_surface( struct window_surface return (struct android_window_surface *)surface; }
-/* store the palette or color mask data in the bitmap info structure */ -static void set_color_info( BITMAPINFO *info, BOOL has_alpha ) -{ - DWORD *colors = (DWORD *)info->bmiColors; - - info->bmiHeader.biSize = sizeof(info->bmiHeader); - info->bmiHeader.biClrUsed = 0; - info->bmiHeader.biBitCount = 32; - if (has_alpha) - { - info->bmiHeader.biCompression = BI_RGB; - return; - } - info->bmiHeader.biCompression = BI_BITFIELDS; - colors[0] = 0xff0000; - colors[1] = 0x00ff00; - colors[2] = 0x0000ff; -} - /* apply the window region to a single line of the destination image. */ static void apply_line_region( DWORD *dst, int width, int x, int y, const RECT *rect, const RECT *end ) { @@ -717,8 +698,7 @@ static BOOL is_argb_surface( struct window_surface *surface ) /*********************************************************************** * create_surface */ -static struct window_surface *create_surface( HWND hwnd, const RECT *rect, - BYTE alpha, COLORREF color_key, BOOL src_alpha ) +static struct window_surface *create_surface( HWND hwnd, const RECT *rect ) { struct android_window_surface *surface; int width = rect->right - rect->left, height = rect->bottom - rect->top; @@ -726,11 +706,13 @@ static struct window_surface *create_surface( HWND hwnd, const RECT *rect, BITMAPINFO *info = (BITMAPINFO *)buffer;
memset( info, 0, sizeof(*info) ); - set_color_info( info, src_alpha ); - info->bmiHeader.biWidth = width; - info->bmiHeader.biHeight = -height; /* top-down */ - info->bmiHeader.biPlanes = 1; - info->bmiHeader.biSizeImage = get_dib_image_size( info ); + info->bmiHeader.biSize = sizeof(info->bmiHeader); + info->bmiHeader.biWidth = width; + info->bmiHeader.biHeight = -height; /* top-down */ + info->bmiHeader.biPlanes = 1; + info->bmiHeader.biBitCount = 32; + info->bmiHeader.biSizeImage = get_dib_image_size(info); + info->bmiHeader.biCompression = BI_RGB;
if (!(surface = calloc( 1, sizeof(*surface) ))) return NULL; if (!window_surface_init( &surface->header, &android_surface_funcs, hwnd, rect, info, 0 )) goto failed; @@ -739,9 +721,6 @@ static struct window_surface *create_surface( HWND hwnd, const RECT *rect,
TRACE( "created %p hwnd %p %s\n", surface, hwnd, wine_dbgstr_rect(rect) );
- if (src_alpha) window_surface_set_layered( &surface->header, color_key, -1, 0xff000000 ); - else window_surface_set_layered( &surface->header, color_key, alpha << 24, 0 ); - return &surface->header;
failed: @@ -1089,10 +1068,6 @@ done: BOOL ANDROID_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct window_surface **surface ) { struct android_win_data *data; - DWORD flags; - COLORREF key; - BYTE alpha; - BOOL layered = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED;
TRACE( "hwnd %p, surface_rect %s, surface %p\n", hwnd, wine_dbgstr_rect( surface_rect ), surface );
@@ -1110,12 +1085,8 @@ BOOL ANDROID_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct wi } }
- if (!layered || !NtUserGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags )) flags = 0; - if (!(flags & LWA_ALPHA)) alpha = 255; - if (!(flags & LWA_COLORKEY)) key = CLR_INVALID; - if (*surface) window_surface_release( *surface ); - *surface = create_surface( data->hwnd, surface_rect, alpha, key, FALSE ); + *surface = create_surface( data->hwnd, surface_rect );
done: release_win_data( data ); @@ -1280,30 +1251,11 @@ void ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) if (data->surface) window_surface_release( data->surface ); data->surface = NULL; } - else if (data->surface) window_surface_set_layered( data->surface, CLR_INVALID, -1, 0 ); } release_win_data( data ); }
-/*********************************************************************** - * ANDROID_SetLayeredWindowAttributes - */ -void ANDROID_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) -{ - struct android_win_data *data; - - if (!(flags & LWA_ALPHA)) alpha = 255; - if (!(flags & LWA_COLORKEY)) key = CLR_INVALID; - - if ((data = get_win_data( hwnd ))) - { - if (data->surface) window_surface_set_layered( data->surface, key, alpha << 24, 0 ); - release_win_data( data ); - } -} - - /***************************************************************************** * ANDROID_CreateLayeredWindow */ @@ -1324,11 +1276,10 @@ BOOL ANDROID_CreateLayeredWindow( HWND hwnd, const RECT *surface_rect, COLORREF
if (!surface || !EqualRect( &surface->rect, surface_rect )) { - data->surface = create_surface( data->hwnd, surface_rect, 255, color_key, TRUE ); + data->surface = create_surface( data->hwnd, surface_rect ); if (surface) window_surface_release( surface ); surface = data->surface; } - else window_surface_set_layered( surface, color_key, -1, 0xff000000 );
if ((*window_surface = surface)) window_surface_add_ref( surface ); release_win_data( data );
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winemac.drv/macdrv.h | 1 - dlls/winemac.drv/surface.c | 10 +++------- dlls/winemac.drv/window.c | 2 -- 3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 8b9e908bc1a..cbb453b2dfa 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -208,7 +208,6 @@ extern BOOL macdrv_SystemParametersInfo(UINT action, UINT int_param, void *ptr_p extern macdrv_window macdrv_get_cocoa_window(HWND hwnd, BOOL require_on_screen); extern RGNDATA *get_region_data(HRGN hrgn, HDC hdc_lptodp); extern void activate_on_following_focus(void); -extern void set_surface_use_alpha(struct window_surface *window_surface, BOOL use_alpha);
extern void macdrv_handle_event(const macdrv_event *event);
diff --git a/dlls/winemac.drv/surface.c b/dlls/winemac.drv/surface.c index fa34a5122ab..b6f0ea2d812 100644 --- a/dlls/winemac.drv/surface.c +++ b/dlls/winemac.drv/surface.c @@ -127,7 +127,7 @@ static struct macdrv_window_surface *get_mac_surface(struct window_surface *surf * create_surface */ static struct window_surface *create_surface(HWND hwnd, macdrv_window window, const RECT *rect, - struct window_surface *old_surface, BOOL use_alpha) + struct window_surface *old_surface) { struct macdrv_window_surface *surface = NULL; int width = rect->right - rect->left, height = rect->bottom - rect->top; @@ -178,9 +178,6 @@ static struct window_surface *create_surface(HWND hwnd, macdrv_window window, co
TRACE("created %p for %p %s\n", surface, window, wine_dbgstr_rect(rect));
- if (use_alpha) window_surface_set_layered( &surface->header, CLR_INVALID, -1, 0xff000000 ); - else window_surface_set_layered( &surface->header, CLR_INVALID, -1, 0 ); - return &surface->header;
failed: @@ -216,7 +213,7 @@ BOOL macdrv_CreateWindowSurface(HWND hwnd, const RECT *surface_rect, struct wind } }
- *surface = create_surface(data->hwnd, data->cocoa_window, surface_rect, data->surface, FALSE); + *surface = create_surface(data->hwnd, data->cocoa_window, surface_rect, data->surface);
done: release_win_data(data); @@ -241,7 +238,7 @@ BOOL macdrv_CreateLayeredWindow(HWND hwnd, const RECT *surface_rect, COLORREF co surface = data->surface; if (!surface || !EqualRect(&surface->rect, surface_rect)) { - data->surface = create_surface(data->hwnd, data->cocoa_window, surface_rect, NULL, TRUE); + data->surface = create_surface(data->hwnd, data->cocoa_window, surface_rect, NULL); if (surface) window_surface_release(surface); surface = data->surface; if (data->unminimized_surface) @@ -250,7 +247,6 @@ BOOL macdrv_CreateLayeredWindow(HWND hwnd, const RECT *surface_rect, COLORREF co data->unminimized_surface = NULL; } } - else window_surface_set_layered(surface, color_key, -1, 0xff000000);
if ((*window_surface = surface)) window_surface_add_ref(surface);
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 0784b0e4e39..6ebaccadbb2 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1683,7 +1683,6 @@ void macdrv_SetLayeredWindowAttributes(HWND hwnd, COLORREF key, BYTE alpha, DWOR { data->layered = TRUE; data->ulw_layered = FALSE; - if (data->surface) window_surface_set_layered(data->surface, key, alpha << 24, 0); if (data->cocoa_window) { sync_window_opacity(data, key, alpha, FALSE, flags); @@ -1782,7 +1781,6 @@ void macdrv_SetWindowStyle(HWND hwnd, INT offset, STYLESTRUCT *style) data->layered = FALSE; data->ulw_layered = FALSE; sync_window_opacity(data, 0, 0, FALSE, 0); - if (data->surface) window_surface_set_layered(data->surface, CLR_INVALID, -1, 0); }
if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYOUTRTL))