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
This commit is contained in:
Manolo Gouy 2017-07-01 10:12:10 +00:00
parent 601e86fba5
commit ba10af9edb
2 changed files with 3 additions and 2 deletions

View File

@ -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);
}

View File

@ -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");