Gabriel Ivăncescu : winex11.drv: Use a helper to retrieve the decoration rect for managed windows.
Alexandre Julliard
julliard at winehq.org
Fri Aug 7 10:42:29 CDT 2020
Module: wine
Branch: stable
Commit: adf448ad97864794906ea47e3f2f8471e1350b65
URL: https://source.winehq.org/git/wine.git/?a=commit;h=adf448ad97864794906ea47e3f2f8471e1350b65
Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date: Tue May 19 15:18:47 2020 +0300
winex11.drv: Use a helper to retrieve the decoration rect for managed windows.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit df0d8ac5be7c8e22175674d6554b53156bfe9a91)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/winex11.drv/window.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 4676b09935..1d987d05f6 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1156,19 +1156,16 @@ void make_window_embedded( struct x11drv_win_data *data )
/***********************************************************************
- * X11DRV_window_to_X_rect
- *
- * Convert a rect from client to X window coordinates
+ * get_decoration_rect
*/
-static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect,
- const RECT *window_rect, const RECT *client_rect )
+static void get_decoration_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;
- RECT rc;
+ SetRectEmpty( rect );
if (!data->managed) return;
- if (IsRectEmpty( rect )) return;
style = GetWindowLongW( data->hwnd, GWL_STYLE );
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
@@ -1181,9 +1178,23 @@ static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect,
ex_style_mask |= WS_EX_DLGMODALFRAME;
}
- SetRectEmpty( &rc );
- AdjustWindowRectEx( &rc, style & style_mask, FALSE, ex_style & ex_style_mask );
+ AdjustWindowRectEx( rect, 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->right -= rc.right;
rect->top -= rc.top;
More information about the wine-cvs
mailing list