diff options
| author | Manolo Gouy <Manolo> | 2017-08-19 07:29:26 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-08-19 07:29:26 +0000 |
| commit | c51cbd0a50ad48234669cfd7752e352299b0f2f4 (patch) | |
| tree | bbe22eb138ff98d1515fd5ea5f73a790cab87baa | |
| parent | b4e434774f311db6deddb6ce61709a5e24af4704 (diff) | |
Prevent situation where SetProcessDPIAwareness was called after Fl_WinAPI_Screen_Driver::init().
The effect was that the file_chooser test app did not recognize the window scaling factor.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12393 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_win32.cxx | 1 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index b8deb0e91..4aa6d7c80 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -508,6 +508,7 @@ void Fl_WinAPI_Screen_Driver::open_display_platform() { SetProcessDpiAwareness_type fl_SetProcessDpiAwareness = (SetProcessDpiAwareness_type)GetProcAddress(hMod, "SetProcessDpiAwareness"); const int PROCESS_PER_MONITOR_DPI_AWARE = 2; if (fl_SetProcessDpiAwareness) fl_SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); + init_screen_scale_factors(); } #endif // FLTK_HIDPI_SUPPORT OleInitialize(0L); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index 1b9b03f17..2582cbd17 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -123,6 +123,7 @@ BOOL Fl_WinAPI_Screen_Driver::screen_cb(HMONITOR mon, HDC, LPRECT r) void Fl_WinAPI_Screen_Driver::init() { + open_display(); // Since not all versions of Windows include multiple monitor support, // we do a run-time check for the required functions... HMODULE hMod = GetModuleHandle("USER32.DLL"); @@ -141,9 +142,6 @@ void Fl_WinAPI_Screen_Driver::init() // NOTE: num_screens is incremented in screen_cb so we must first reset it here... num_screens = 0; fl_edm(0, 0, screen_cb, (LPARAM)this); -#ifdef FLTK_HIDPI_SUPPORT - init_screen_scale_factors(); -#endif return; } } |
