Commit df0d8ac5 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

winex11.drv: Use a helper to retrieve the decoration rect for managed windows.

parent 55ba3648
...@@ -1154,19 +1154,16 @@ void make_window_embedded( struct x11drv_win_data *data ) ...@@ -1154,19 +1154,16 @@ void make_window_embedded( struct x11drv_win_data *data )
/*********************************************************************** /***********************************************************************
* X11DRV_window_to_X_rect * get_decoration_rect
*
* 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 get_decoration_rect( struct x11drv_win_data *data, RECT *rect,
const RECT *window_rect, const RECT *client_rect ) const RECT *window_rect, const RECT *client_rect )
{ {
DWORD style, ex_style, style_mask = 0, ex_style_mask = 0; DWORD style, ex_style, style_mask = 0, ex_style_mask = 0;
unsigned long decor; unsigned long decor;
RECT rc;
SetRectEmpty( rect );
if (!data->managed) return; if (!data->managed) return;
if (IsRectEmpty( rect )) return;
style = GetWindowLongW( data->hwnd, GWL_STYLE ); style = GetWindowLongW( data->hwnd, GWL_STYLE );
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE ); ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
...@@ -1179,9 +1176,23 @@ static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect, ...@@ -1179,9 +1176,23 @@ static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect,
ex_style_mask |= WS_EX_DLGMODALFRAME; ex_style_mask |= WS_EX_DLGMODALFRAME;
} }
SetRectEmpty( &rc ); AdjustWindowRectEx( rect, style & style_mask, FALSE, ex_style & ex_style_mask );
AdjustWindowRectEx( &rc, style & style_mask, FALSE, ex_style & ex_style_mask ); }
/***********************************************************************
* X11DRV_window_to_X_rect
*
* Convert a rect from client to X window coordinates
*/
static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect,
const RECT *window_rect, const RECT *client_rect )
{
RECT rc;
if (IsRectEmpty( rect )) return;
get_decoration_rect( data, &rc, window_rect, client_rect );
rect->left -= rc.left; rect->left -= rc.left;
rect->right -= rc.right; rect->right -= rc.right;
rect->top -= rc.top; rect->top -= rc.top;
......
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