diff options
| -rw-r--r-- | FL/Fl_Screen_Driver.H | 4 | ||||
| -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 |
9 files changed, 26 insertions, 20 deletions
diff --git a/FL/Fl_Screen_Driver.H b/FL/Fl_Screen_Driver.H index 84f25d9fa..f1e33ebaf 100644 --- a/FL/Fl_Screen_Driver.H +++ b/FL/Fl_Screen_Driver.H @@ -155,8 +155,10 @@ public: // optional methods to enable/disable input methods for complex scripts virtual void enable_im() {} virtual void disable_im() {} + // calls open_display_platform() and then does platform-independent work + void open_display(); // implement to open access to the display - virtual void open_display() {} + virtual void open_display_platform() {} // optional method to close display access virtual void close_display() {} // compute dimensions of an Fl_Offscreen 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); |
