summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-06-29 09:44:35 +0000
committerManolo Gouy <Manolo>2017-06-29 09:44:35 +0000
commit7dc496e97d3d9fbc71ffd75b6c4ceb5cfe93ffa5 (patch)
treef1d72ac73196a8d05462f1b46a8d3888e2ae645b /src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
parentc6c4e8d426bba89736d1fc79eb464c5b6d14935f (diff)
HiDPI support for WIN32 platform: begin to support screen-specific scale factor.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12280 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 0229f3cce..079ca743d 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -48,6 +48,7 @@ Fl_WinAPI_Window_Driver::Fl_WinAPI_Window_Driver(Fl_Window *win)
icon_ = new icon_data;
memset(icon_, 0, sizeof(icon_data));
cursor = NULL;
+ screen_num_ = -1;
}
@@ -60,6 +61,13 @@ Fl_WinAPI_Window_Driver::~Fl_WinAPI_Window_Driver()
delete icon_;
}
+int Fl_WinAPI_Window_Driver::screen_num() {
+ if (pWindow->parent()) {
+ screen_num_ = pWindow->top_window()->driver()->screen_num();
+ }
+ return screen_num_ >= 0 ? screen_num_ : 0;
+}
+
RECT // frame of the decorated window in screen coordinates
Fl_WinAPI_Window_Driver::border_width_title_bar_height(
@@ -395,7 +403,7 @@ void Fl_WinAPI_Window_Driver::make_current() {
#endif // USE_COLORMAP
fl_graphics_driver->clip_region(0);
- fl_graphics_driver->scale(Fl::screen_driver()->scale(0));
+ fl_graphics_driver->scale(Fl::screen_driver()->scale(screen_num()));
fl_graphics_driver->line_style(FL_SOLID); // scale also default line width
}
@@ -489,6 +497,7 @@ void Fl_WinAPI_Window_Driver::hide() {
if (pWindow->non_modal() && Fl::first_window() && Fl::first_window()->shown())
Fl::first_window()->show();
delete ip;
+ screen_num_ = -1;
}