From ff372c86d8ef225ce87d1ff5539f2000e1849250 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 29 Nov 2020 09:48:23 +0100 Subject: Fix for issue #123 - Windows platform --- src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H | 1 + src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 10 ++++++++++ 2 files changed, 11 insertions(+) (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 2964375f1..9bd8485a3 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -54,6 +54,7 @@ public: virtual int w(); virtual int h(); virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n); + void screen_xywh_unscaled(int &X, int &Y, int &W, int &H, int n); virtual void screen_dpi(float &h, float &v, int n=0); int screen_num_unscaled(int x, int y); virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index 440bf2762..659113c3c 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -175,6 +175,16 @@ void Fl_WinAPI_Screen_Driver::screen_xywh(int &X, int &Y, int &W, int &H, int n) } +void Fl_WinAPI_Screen_Driver::screen_xywh_unscaled(int &X, int &Y, int &W, int &H, int n) { + if (num_screens < 0) init(); + if ((n < 0) || (n >= num_screens)) n = 0; + X = screens[n].left; + Y = screens[n].top; + W = screens[n].right - screens[n].left; + H = screens[n].bottom - screens[n].top; +}; + + void Fl_WinAPI_Screen_Driver::screen_dpi(float &h, float &v, int n) { if (num_screens < 0) init(); -- cgit v1.2.3