You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Rebase against ced1402d20ba874f9634a306630455366c3865b5.
This commit is contained in:
@@ -1,110 +0,0 @@
|
||||
From 3b6ade8a6088fe6030a95b8062d823eafb2bfbfd Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 24 Jan 2017 12:37:46 +0100
|
||||
Subject: [PATCH] winex11: Fix alpha blending in X11DRV_UpdateLayeredWindow.
|
||||
|
||||
Based on a patch by Dmitry Timoshkov.
|
||||
---
|
||||
dlls/winex11.drv/window.c | 28 +++++++++++++---------------
|
||||
1 file changed, 13 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
|
||||
index 8399a816fa7..110865d2388 100644
|
||||
--- a/dlls/winex11.drv/window.c
|
||||
+++ b/dlls/winex11.drv/window.c
|
||||
@@ -424,14 +424,11 @@ static void sync_window_region( struct x11drv_win_data *data, HRGN win_region )
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
- * sync_window_opacity
|
||||
+ * set_window_opacity
|
||||
*/
|
||||
-static void sync_window_opacity( Display *display, Window win,
|
||||
- COLORREF key, BYTE alpha, DWORD flags )
|
||||
+static void set_window_opacity( Display *display, Window win, BYTE alpha )
|
||||
{
|
||||
- unsigned long opacity = 0xffffffff;
|
||||
-
|
||||
- if (flags & LWA_ALPHA) opacity = (0xffffffff / 0xff) * alpha;
|
||||
+ unsigned long opacity = (0xffffffff / 0xff) * alpha;
|
||||
|
||||
if (opacity == 0xffffffff)
|
||||
XDeleteProperty( display, win, x11drv_atom(_NET_WM_WINDOW_OPACITY) );
|
||||
@@ -1662,7 +1659,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 );
|
||||
+ set_window_opacity( data->display, data->whole_window, (layered_flags & LWA_ALPHA) ? alpha : 0xff );
|
||||
|
||||
XFlush( data->display ); /* make sure the window exists before we start painting to it */
|
||||
|
||||
@@ -1794,7 +1791,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 );
|
||||
+ set_window_opacity( data->display, data->whole_window, 0xff );
|
||||
if (data->surface) set_surface_color_key( data->surface, CLR_INVALID );
|
||||
}
|
||||
done:
|
||||
@@ -2840,7 +2837,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 );
|
||||
+ set_window_opacity( data->display, data->whole_window, (flags & LWA_ALPHA) ? alpha : 0xff );
|
||||
if (data->surface)
|
||||
set_surface_color_key( data->surface, (flags & LWA_COLORKEY) ? key : CLR_INVALID );
|
||||
|
||||
@@ -2864,7 +2861,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 );
|
||||
+ set_window_opacity( gdi_display, win, (flags & LWA_ALPHA) ? alpha : 0xff );
|
||||
if (flags & LWA_COLORKEY)
|
||||
FIXME( "LWA_COLORKEY not supported on foreign process window %p\n", hwnd );
|
||||
}
|
||||
@@ -2880,7 +2877,6 @@ BOOL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
|
||||
{
|
||||
struct window_surface *surface;
|
||||
struct x11drv_win_data *data;
|
||||
- BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, 0 };
|
||||
COLORREF color_key = (info->dwFlags & ULW_COLORKEY) ? info->crKey : CLR_INVALID;
|
||||
char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
|
||||
BITMAPINFO *bmi = (BITMAPINFO *)buffer;
|
||||
@@ -2908,6 +2904,10 @@ BOOL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
|
||||
}
|
||||
else set_surface_color_key( surface, color_key );
|
||||
|
||||
+ if (data->whole_window)
|
||||
+ set_window_opacity( data->display, data->whole_window,
|
||||
+ (info->dwFlags & ULW_ALPHA) ? info->pblend->SourceConstantAlpha : 0xff );
|
||||
+
|
||||
if (surface) window_surface_add_ref( surface );
|
||||
mapped = data->mapped;
|
||||
release_win_data( data );
|
||||
@@ -2942,17 +2942,15 @@ BOOL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
|
||||
{
|
||||
intersect_rect( &rect, &rect, info->prcDirty );
|
||||
memcpy( src_bits, dst_bits, bmi->bmiHeader.biSizeImage );
|
||||
- NtGdiPatBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, BLACKNESS );
|
||||
}
|
||||
src_rect = rect;
|
||||
if (info->pptSrc) OffsetRect( &src_rect, info->pptSrc->x, info->pptSrc->y );
|
||||
NtGdiTransformPoints( info->hdcSrc, (POINT *)&src_rect, (POINT *)&src_rect, 2, NtGdiDPtoLP );
|
||||
|
||||
- if (info->dwFlags & ULW_ALPHA) blend = *info->pblend;
|
||||
- ret = NtGdiAlphaBlend( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
|
||||
+ ret = NtGdiStretchBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
|
||||
info->hdcSrc, src_rect.left, src_rect.top,
|
||||
src_rect.right - src_rect.left, src_rect.bottom - src_rect.top,
|
||||
- *(DWORD *)&blend, 0 );
|
||||
+ SRCCOPY, 0 );
|
||||
if (ret)
|
||||
{
|
||||
memcpy( dst_bits, src_bits, bmi->bmiHeader.biSizeImage );
|
||||
--
|
||||
2.40.1
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: [33943] Fix alpha blending in X11DRV_UpdateLayeredWindow
|
||||
Disabled: True
|
@@ -1 +1 @@
|
||||
e66405a5040ac233ebdc7bdd925919ad63b4dd69
|
||||
ced1402d20ba874f9634a306630455366c3865b5
|
||||
|
Reference in New Issue
Block a user