From 5dbfe413ae8bd6aca1dfa36f79bb1168aaa50823 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 25 Aug 2016 12:42:50 +0000 Subject: Fix computation of Fl_Window::decorated_w() and decorated_h() when apps are resized through display setting. Under Windows 10: when the user sets the value of "Change the size of text, apps and other items" in display settings to above 100 %, the computation of Fl_Window::decorated_w() and decorated_h() has to take the scaling factor into account. This factor is also necessary to draw correctly window title bars. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_win32.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Fl_win32.cxx') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index b914a46c7..b5dfa474b 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -2391,7 +2391,8 @@ void Fl_WinAPI_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top top = left = bottom = right = NULL; if (!shown() || parent() || !border() || !visible()) return; int wsides, hbottom, bt; - RECT r = border_width_title_bar_height(wsides, hbottom, bt); + float scaling; + RECT r = border_width_title_bar_height(wsides, hbottom, bt, &scaling); int htop = bt + hbottom; Fl_Surface_Device *previous = Fl_Surface_Device::surface(); Window save_win = fl_window; @@ -2403,8 +2404,9 @@ void Fl_WinAPI_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top int ww = w() + 2 * wsides; // capture the 4 window sides from screen if (htop) { - r_top = Fl::screen_driver()->read_win_rectangle(NULL, r.left, r.top, ww, htop, 0); + r_top = Fl::screen_driver()->read_win_rectangle(NULL, r.left, r.top, r.right - r.left + 1, htop, 0); top = Fl_Shared_Image::get(r_top); + if (scaling >= 1.1) top->scale(ww, htop/scaling, 0); } if (wsides) { r_left = Fl::screen_driver()->read_win_rectangle(NULL, r.left, r.top + htop, wsides, h(), 0); -- cgit v1.2.3