Alexandre Julliard : winex11: Synchronize the shaped flag with the window region before determining the window size .
Alexandre Julliard
julliard at winehq.org
Wed Feb 3 09:33:03 CST 2010
Module: wine
Branch: master
Commit: aa4778413025a5b93695cd97ab39fc77e3e838fe
URL: http://source.winehq.org/git/wine.git/?a=commit;h=aa4778413025a5b93695cd97ab39fc77e3e838fe
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Feb 1 22:35:32 2010 +0100
winex11: Synchronize the shaped flag with the window region before determining the window size.
---
dlls/winex11.drv/window.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index ec7f6dd..1dfecce 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1444,6 +1444,7 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
COLORREF key;
BYTE alpha;
DWORD layered_flags;
+ HRGN win_rgn;
if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->window_rect ))
{
@@ -1452,6 +1453,14 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
SetPropA( data->hwnd, managed_prop, (HANDLE)1 );
}
+ if ((win_rgn = CreateRectRgn( 0, 0, 0, 0 )) &&
+ GetWindowRgn( data->hwnd, win_rgn ) == ERROR)
+ {
+ DeleteObject( win_rgn );
+ win_rgn = 0;
+ }
+ data->shaped = (win_rgn != 0);
+
mask = get_window_attributes( display, data, &attr );
data->whole_rect = data->window_rect;
@@ -1471,7 +1480,7 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
if (data->whole_window) XSaveContext( display, data->whole_window, winContext, (char *)data->hwnd );
wine_tsx11_unlock();
- if (!data->whole_window) return 0;
+ if (!data->whole_window) goto done;
if (!create_client_window( display, data, NULL ))
{
@@ -1480,7 +1489,7 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
XDestroyWindow( display, data->whole_window );
data->whole_window = 0;
wine_tsx11_unlock();
- return 0;
+ goto done;
}
set_initial_wm_hints( display, data );
@@ -1493,7 +1502,7 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
sync_window_text( display, data->whole_window, text );
/* set the window region */
- sync_window_region( display, data, (HRGN)1 );
+ if (win_rgn) sync_window_region( display, data, win_rgn );
/* set the window opacity */
if (!GetLayeredWindowAttributes( data->hwnd, &key, &alpha, &layered_flags )) layered_flags = 0;
@@ -1502,6 +1511,8 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
wine_tsx11_lock();
XFlush( display ); /* make sure the window exists before we start painting to it */
wine_tsx11_unlock();
+done:
+ if (win_rgn) DeleteObject( win_rgn );
return data->whole_window;
}
More information about the wine-cvs
mailing list