diff options
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index 0e8e9b3d3..20a84736a 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -92,7 +92,6 @@ RECT // frame of the decorated window in screen coordinates static DwmGetWindowAttribute_type DwmGetWindowAttribute = dwmapi_dll ? (DwmGetWindowAttribute_type)GetProcAddress(dwmapi_dll, "DwmGetWindowAttribute") : NULL; int need_r = 1; - float scaling = ((Fl_WinAPI_Screen_Driver*)Fl::screen_driver())->DWM_scaling_factor(screen_num()); if (DwmGetWindowAttribute) { const DWORD DWMWA_EXTENDED_FRAME_BOUNDS = 9; if ( DwmGetWindowAttribute(fl_xid(win), DWMWA_EXTENDED_FRAME_BOUNDS, &r, sizeof(RECT)) == S_OK ) { @@ -102,12 +101,21 @@ RECT // frame of the decorated window in screen coordinates if (need_r) { GetWindowRect(fl_xid(win), &r); } + int width, height; +#ifdef FLTK_HIDPI_SUPPORT RECT rc; GetClientRect(fl_xid(win), &rc); - bx = (r.right - r.left - rc.right)/2; + width = rc.right; + height = rc.bottom; +#else + float scaling = ((Fl_WinAPI_Screen_Driver*)Fl::screen_driver())->DWM_scaling_factor(0); + width = int(win->w() * scaling); + height = int(win->h() * scaling); +#endif + bx = (r.right - r.left - width)/2; if (bx < 1) bx = 1; by = bx; - bt = r.bottom - r.top - rc.bottom - 2 * by; + bt = r.bottom - r.top - height - 2 * by; } return r; } |
