From 62661fe759dfc826f31b032e49f0f15b40a207d5 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 19 Aug 2015 08:49:41 +0200 Subject: [PATCH] In w32fns.c condition TITLEBAR_INFO declaration on WINDOWS version. * src/w32fns.c (TITLEBAR_INFO): Make it a typedef so MinGW64 builds can use the declaration from the system headers. (GetTitleBarInfo_Proc, Fx_frame_geometry): Adapt to new definition of TITLEBAR_INFO. Suggested by Eli Zaretskii --- src/w32fns.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/w32fns.c b/src/w32fns.c index 8f0bde70875..189a27c62f1 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -138,13 +138,18 @@ struct MONITOR_INFO DWORD dwFlags; }; +#if _WIN32_WINDOWS >= 0x0410 +#define C_CHILDREN_TITLEBAR CCHILDREN_TITLEBAR +typedef TITLEBARINFO TITLEBAR_INFO; +#else #define C_CHILDREN_TITLEBAR 5 -struct TITLEBAR_INFO +typedef struct { DWORD cbSize; RECT rcTitleBar; DWORD rgstate[C_CHILDREN_TITLEBAR+1]; -}; +} TITLEBAR_INFO, *PTITLEBAR_INFO; +#endif #ifndef CCHDEVICENAME #define CCHDEVICENAME 32 @@ -181,7 +186,7 @@ typedef BOOL CALLBACK (* MonitorEnum_Proc) typedef BOOL (WINAPI * EnumDisplayMonitors_Proc) (IN HDC hdc, IN RECT *rcClip, IN MonitorEnum_Proc fnEnum, IN LPARAM dwData); typedef BOOL (WINAPI * GetTitleBarInfo_Proc) - (IN HWND hwnd, OUT struct TITLEBAR_INFO* info); + (IN HWND hwnd, OUT TITLEBAR_INFO* info); TrackMouseEvent_Proc track_mouse_event_fn = NULL; ImmGetCompositionString_Proc get_composition_string_fn = NULL; @@ -8064,7 +8069,7 @@ and width values are in pixels. { if (get_title_bar_info_fn) { - struct TITLEBAR_INFO title_bar; + TITLEBAR_INFO title_bar; title_bar.cbSize = sizeof (title_bar); title_bar.rcTitleBar.left = title_bar.rcTitleBar.right = 0; -- 2.39.2