Commit aa477841 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Synchronize the shaped flag with the window region before determining the window size.

parent 4356e494
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment