diff options
| author | Manolo Gouy <Manolo> | 2017-06-01 14:05:47 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-06-01 14:05:47 +0000 |
| commit | 90efebb97e5a97514cfdeb92bdf0bc462099b4cd (patch) | |
| tree | ea211f7ae6836411d57d3632faf3c26171607d8c /src | |
| parent | 3a390bfb5fd2dc0c0b034c262cf79a6fb1db1e5f (diff) | |
Divide virtual Fl_Screen_Driver::open_display() in a platform-specific part followed by a platform-independent part.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12245 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 13 | ||||
| -rw-r--r-- | src/Fl_Screen_Driver.cxx | 17 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 2 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 2 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H | 2 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H | 2 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Screen_Driver.H | 2 |
8 files changed, 23 insertions, 19 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 8dc948b7e..5000993e9 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1978,19 +1978,6 @@ void Fl::disable_im() void fl_open_display() { Fl::screen_driver()->open_display(); - static bool been_here = false; - if (!been_here) { - been_here = true; - Fl_Screen_Driver *dr = Fl::screen_driver(); - if (dr->rescalable()) { - float factor = dr->default_scale_factor(); - for (int i = 0; i < dr->screen_count(); i++) dr->scale(i, factor); -#if defined(FLTK_HIDPI_SUPPORT) || !(defined(WIN32) || defined(__APPLE__)) - Fl::add_handler(Fl_Screen_Driver::scale_handler); -#endif - Fl_Graphics_Driver::default_driver().scale(factor); - } - } } void fl_close_display() diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index 4abecc956..1ccc7ff5f 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -502,6 +502,23 @@ float Fl_Screen_Driver::default_scale_factor() } +void Fl_Screen_Driver::open_display() +{ + open_display_platform(); + static bool been_here = false; + if (!been_here) { + been_here = true; + if (rescalable()) { + float factor = default_scale_factor(); + for (int i = 0; i < screen_count(); i++) scale(i, factor); +#if defined(FLTK_HIDPI_SUPPORT) || !(defined(WIN32) || defined(__APPLE__)) + Fl::add_handler(Fl_Screen_Driver::scale_handler); +#endif + Fl_Graphics_Driver::default_driver().scale(factor); + } + } +} + // // End of "$Id$". // diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index a1878d761..41b3e9e41 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1703,7 +1703,7 @@ void Fl_Darwin_System_Driver::open_callback(void (*cb)(const char *)) { } */ -void Fl_Cocoa_Screen_Driver::open_display() { +void Fl_Cocoa_Screen_Driver::open_display_platform() { static char beenHereDoneThat = 0; if ( !beenHereDoneThat ) { beenHereDoneThat = 1; diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 7507b6fb4..0491c6bb9 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -492,7 +492,7 @@ int Fl_WinAPI_Screen_Driver::ready() { //FILE *LOG=fopen("log.log","w"); -void Fl_WinAPI_Screen_Driver::open_display() { +void Fl_WinAPI_Screen_Driver::open_display_platform() { static char beenHereDoneThat = 0; if (beenHereDoneThat) diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index ac56e64aa..8f0f01651 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -601,7 +601,7 @@ void Fl_X11_Screen_Driver::disable_im() { fl_xim_deactivate(); } -void Fl_X11_Screen_Driver::open_display() { +void Fl_X11_Screen_Driver::open_display_platform() { if (fl_display) return; setlocale(LC_CTYPE, ""); diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H index d825e6580..e64d394f4 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H @@ -93,7 +93,7 @@ public: virtual void get_mouse(int &x, int &y); virtual void enable_im(); virtual void disable_im(); - virtual void open_display(); + virtual void open_display_platform(); // --- compute dimensions of an Fl_Offscreen virtual void offscreen_size(Fl_Offscreen o, int &width, int &height); }; diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H index ff2688bcf..9cb234a37 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -76,7 +76,7 @@ public: virtual void get_mouse(int &x, int &y); virtual void enable_im(); virtual void disable_im(); - virtual void open_display(); + virtual void open_display_platform(); virtual void offscreen_size(Fl_Offscreen off, int &width, int &height); virtual APP_SCALING_CAPABILITY rescalable() { return SYSTEMWIDE_APP_SCALING; } diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H index 8ccf056da..ac03a42ca 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.H +++ b/src/drivers/X11/Fl_X11_Screen_Driver.H @@ -99,7 +99,7 @@ public: virtual void get_mouse(int &x, int &y); virtual void enable_im(); virtual void disable_im(); - virtual void open_display(); + virtual void open_display_platform(); virtual void close_display(); // --- compute dimensions of an Fl_Offscreen virtual void offscreen_size(Fl_Offscreen o, int &width, int &height); |
