diff options
| author | Manolo Gouy <Manolo> | 2018-02-18 16:58:38 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-02-18 16:58:38 +0000 |
| commit | 288d61a953eb8f024a99f96a9f31dcc85cf554f4 (patch) | |
| tree | b3b2e1319c65d8dd2b76f9dc9324295db6aac9df /src | |
| parent | 6721ba67eb1a27da68c71d70b37dacc7a84ec06e (diff) | |
Don't use FLTK's way to support HighDPI screens when the app has set a DPI awareness through a manifest.
FLTK reads during fl_open_display() the scaling factor of each screen and uses that to transform
FLTK units into screen units. This change avoids this reading if the app declared to be DPI-aware
though a manifest, a symptom that the app supports HighDPI independently from FLTK.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12677 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_win32.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 20cf3e879..93ea280be 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -524,9 +524,10 @@ void Fl_WinAPI_Screen_Driver::open_display_platform() { if (hMod) { 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(); + if (fl_SetProcessDpiAwareness) { + HRESULT hr = fl_SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); + if (hr == S_OK) init_screen_scale_factors(); + } } #endif // FLTK_HIDPI_SUPPORT OleInitialize(0L); @@ -549,7 +550,7 @@ void Fl_WinAPI_Screen_Driver::init_screen_scale_factors() { HRESULT r = fl_GetDpiForMonitor(hm, 0, &dpiX, &dpiY); float f = (r == S_OK ? dpiX / 96. : 1); scale(ns, f); - // fprintf(LOG, "desktop_scale_factor ns=%d factor=%.2f\n", ns, f);fflush(LOG); + //fprintf(LOG, "desktop_scale_factor ns=%d factor=%.2f\n", ns, scale(ns));fflush(LOG); } } } |
