From ba10af9edb594f69e58e6f2ccb251e3bdff3e9c6 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 1 Jul 2017 10:12:10 +0000 Subject: WIN32: fix error when building without FLTK_HIDPI_SUPPORT. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12284 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Screen_Driver.cxx | 3 ++- src/Fl_win32.cxx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index 29fcffd14..0332f59b3 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -493,9 +493,10 @@ void Fl_Screen_Driver::open_display() static bool been_here = false; if (!been_here) { been_here = true; + int ns = screen_count(); if (rescalable()) { float factor = default_scale_factor(); - for (int i = 0; i < screen_count(); i++) scale(i, factor); + for (int i = 0; i < ns; i++) scale(i, factor); Fl::add_handler(Fl_Screen_Driver::scale_handler); Fl_Graphics_Driver::default_driver().scale(factor); } diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 2a16a43d3..0366178bc 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -516,9 +516,9 @@ void Fl_WinAPI_Screen_Driver::open_display_platform() { float Fl_WinAPI_Screen_Driver::desktop_scale_factor() { - typedef HRESULT (WINAPI* GetDpiForMonitor_type)(HMONITOR, int, UINT*, UINT*); float f = 1; #ifdef FLTK_HIDPI_SUPPORT + typedef HRESULT (WINAPI* GetDpiForMonitor_type)(HMONITOR, int, UINT*, UINT*); HMODULE hMod = LoadLibrary("Shcore.DLL"); GetDpiForMonitor_type fl_GetDpiForMonitor = NULL; if (hMod) fl_GetDpiForMonitor = (GetDpiForMonitor_type)GetProcAddress(hMod, "GetDpiForMonitor"); -- cgit v1.2.3