From d988930461b449f8e0c29507048e3a3b205504d7 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 6 Mar 2019 11:10:37 +0100 Subject: Process env var FLTK_SCALING_FACTOR consistently across platforms. The procedure to set screen scaling factors becomes: 1) each screen scaling factor is set to 1 2) the OS is queried according to each platform to get screen scaling factor values 3) The value of FLTK_SCALING_FACTOR, if present, is used to multiply scaling factors --- src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H | 3 +-- src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'src/drivers/WinAPI') diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H index c86124a0e..82205cca7 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -42,7 +42,6 @@ protected: static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM); BOOL screen_cb(HMONITOR mon, HDC, LPRECT r); int get_mouse_unscaled(int &mx, int &my); - void init_screen_scale_factors(); public: Fl_WinAPI_Screen_Driver() : Fl_Screen_Driver() { @@ -92,7 +91,7 @@ public: virtual void scale(int n, float f) { scale_of_screen[n] = f; } - virtual float desktop_scale_factor(); + virtual void desktop_scale_factor(); }; diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index cf5f30f5f..147933446 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -158,11 +158,6 @@ void Fl_WinAPI_Screen_Driver::init() } -float Fl_WinAPI_Screen_Driver::desktop_scale_factor() { - return 0; //indicates each screen has already been assigned its scale factor value -} - - void Fl_WinAPI_Screen_Driver::screen_work_area(int &X, int &Y, int &W, int &H, int n) { if (num_screens < 0) init(); -- cgit v1.2.3