diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2014-10-08 11:57:43 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2014-10-08 11:57:43 +0000 |
| commit | 15de7c0600ade64152e1fc32e81a5e6b0c9f10b2 (patch) | |
| tree | 953b56504e9803f9bcd15ebd02dd4f095b1a13d0 | |
| parent | fc912ef78608a8ecdbca5db701b44ce0953844aa (diff) | |
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
| -rw-r--r-- | src/Fl_win32.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
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); } |
