mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:08:19 +00:00
winex11.drv: Remove frame when non-client area is empty.
Several applications -Steam, Battle.net for instance- handle the WM_NCCALCSIZE message to override the non-client areas size and make the client area cover the whole window, instead of changing the styles. In winex11.drv, in decorated mode, we adjust the window rect according to the window style to hide the unwanted decorations behind the frame, but when client and window rects are equals, there's nothing to hide and the actual window styles are irrelevant and can safely be ignored. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40930 Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3b19726788
commit
47f69a2248
|
@ -280,13 +280,16 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl
|
|||
* get_mwm_decorations
|
||||
*/
|
||||
static unsigned long get_mwm_decorations( struct x11drv_win_data *data,
|
||||
DWORD style, DWORD ex_style )
|
||||
DWORD style, DWORD ex_style,
|
||||
const RECT *window_rect,
|
||||
const RECT *client_rect )
|
||||
{
|
||||
unsigned long ret = 0;
|
||||
|
||||
if (!decorated_mode) return 0;
|
||||
|
||||
if (IsRectEmpty( &data->window_rect )) return 0;
|
||||
if (EqualRect( window_rect, client_rect )) return 0;
|
||||
if (IsRectEmpty( window_rect )) return 0;
|
||||
if (data->shaped) return 0;
|
||||
|
||||
if (ex_style & WS_EX_TOOLWINDOW) return 0;
|
||||
|
@ -712,7 +715,7 @@ static void set_mwm_hints( struct x11drv_win_data *data, DWORD style, DWORD ex_s
|
|||
}
|
||||
else
|
||||
{
|
||||
mwm_hints.decorations = get_mwm_decorations( data, style, ex_style );
|
||||
mwm_hints.decorations = get_mwm_decorations( data, style, ex_style, &data->window_rect, &data->client_rect );
|
||||
mwm_hints.functions = MWM_FUNC_MOVE;
|
||||
if (is_window_resizable( data, style )) mwm_hints.functions |= MWM_FUNC_RESIZE;
|
||||
if (!(style & WS_DISABLED))
|
||||
|
@ -1157,7 +1160,8 @@ void make_window_embedded( struct x11drv_win_data *data )
|
|||
*
|
||||
* Convert a rect from client to X window coordinates
|
||||
*/
|
||||
static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect )
|
||||
static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect,
|
||||
const RECT *window_rect, const RECT *client_rect )
|
||||
{
|
||||
DWORD style, ex_style, style_mask = 0, ex_style_mask = 0;
|
||||
unsigned long decor;
|
||||
|
@ -1168,7 +1172,7 @@ static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect )
|
|||
|
||||
style = GetWindowLongW( data->hwnd, GWL_STYLE );
|
||||
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
|
||||
decor = get_mwm_decorations( data, style, ex_style );
|
||||
decor = get_mwm_decorations( data, style, ex_style, window_rect, client_rect );
|
||||
|
||||
if (decor & MWM_DECOR_TITLE) style_mask |= WS_CAPTION;
|
||||
if (decor & MWM_DECOR_BORDER)
|
||||
|
@ -2274,7 +2278,7 @@ void CDECL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flag
|
|||
}
|
||||
|
||||
*visible_rect = *window_rect;
|
||||
X11DRV_window_to_X_rect( data, visible_rect );
|
||||
X11DRV_window_to_X_rect( data, visible_rect, window_rect, client_rect );
|
||||
|
||||
/* create the window surface if necessary */
|
||||
|
||||
|
|
Loading…
Reference in a new issue