From 15de7c0600ade64152e1fc32e81a5e6b0c9f10b2 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 8 Oct 2014 11:57:43 +0000 Subject: Fix border padding for special cases (STR #3061), Windows only. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10363 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_win32.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index ff6da442d..bbe9905e6 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -201,6 +201,9 @@ static Fl_Window *track_mouse_win=0; // current TrackMouseEvent() window # define WHEEL_DELTA 120 // according to MSDN. #endif +#ifndef SM_CXPADDEDBORDER +# define SM_CXPADDEDBORDER (92) // STR #3061 +#endif // // WM_FLSELECT is the user-defined message that we get when one of @@ -1485,13 +1488,17 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) if (fallback) { if (w->border() && !w->parent()) { if (w->size_range_set && (w->maxw != w->minw || w->maxh != w->minh)) { - ret = 2; - bx = GetSystemMetrics(SM_CXSIZEFRAME); - by = GetSystemMetrics(SM_CYSIZEFRAME); + ret = 2; + bx = GetSystemMetrics(SM_CXSIZEFRAME); + by = GetSystemMetrics(SM_CYSIZEFRAME); } else { - ret = 1; - bx = GetSystemMetrics(SM_CXFIXEDFRAME); - by = GetSystemMetrics(SM_CYFIXEDFRAME); + ret = 1; + int padding = GetSystemMetrics(SM_CXPADDEDBORDER); + NONCLIENTMETRICS ncm; + ncm.cbSize = sizeof(NONCLIENTMETRICS); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); + bx = GetSystemMetrics(SM_CXFIXEDFRAME) + (padding ? padding + ncm.iBorderWidth : 0); + by = GetSystemMetrics(SM_CYFIXEDFRAME) + (padding ? padding + ncm.iBorderWidth : 0); } bt = GetSystemMetrics(SM_CYCAPTION); } -- cgit v1.2.3