summaryrefslogtreecommitdiff
path: root/src/drivers/GDI
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-03-09 16:27:27 +0000
committerManolo Gouy <Manolo>2018-03-09 16:27:27 +0000
commit7f78b1ef1468bb8242fb7fb37e3f27d0a8052ce1 (patch)
tree517c45c18c7dc28f8d3a05662a75497c408c1dbe /src/drivers/GDI
parent12f628514771294102d2aa961373373a95ddab6b (diff)
Windows: remove necessity to compile with -DFLTK_HIDPI_SUPPORT to make WIN32 FLTK apps DPI-aware.
At this point, Windows FLTK apps detect HighDPI displays and rescale their GUI accordingly. They also all reply to ctrl/+/-/0/ keystrokes to enlarge/shrink/reset their windows. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12723 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI')
-rw-r--r--src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx4
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx14
2 files changed, 2 insertions, 16 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx
index c68bf7e20..58fc1a8f2 100644
--- a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx
@@ -60,12 +60,8 @@ Fl_GDI_Copy_Surface_Driver::Fl_GDI_Copy_Surface_Driver(int w, int h) : Fl_Copy_S
float factorw = (100.f * hmm) / hdots;
float factorh = (100.f * vmm) / vdots;
// Global display scaling factor: 1, 1.25, 1.5, 1.75, etc...
-#ifdef FLTK_HIDPI_SUPPORT
float scaling = Fl_Graphics_Driver::default_driver().scale();
((Fl_GDI_Graphics_Driver*)driver())->scale(scaling);
-#else
- float scaling = 1/((Fl_WinAPI_Screen_Driver*)Fl::screen_driver())->DWM_scaling_factor();
-#endif
RECT rect; rect.left = 0; rect.top = 0; rect.right = (LONG)((w*scaling) * factorw); rect.bottom = (LONG)((h*scaling) * factorh);
gc = CreateEnhMetaFile (NULL, NULL, &rect, NULL);
if (gc != NULL) {
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx
index c495b5223..3b86650c8 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx
@@ -86,9 +86,7 @@ static void set_xmap(Fl_XMap& xmap, COLORREF c, int lw) {
// xmap.pen = CreatePen(PS_SOLID, 1, xmap.rgb); // get a pen into xmap.pen
LOGBRUSH penbrush = {BS_SOLID, xmap.rgb, 0};
xmap.pen = ExtCreatePen(PS_GEOMETRIC | PS_ENDCAP_FLAT | PS_JOIN_ROUND, lw, &penbrush, 0, 0);
-#ifdef FLTK_HIDPI_SUPPORT
xmap.pwidth = lw;
-#endif
xmap.brush = -1;
}
@@ -100,11 +98,7 @@ void Fl_GDI_Graphics_Driver::color(Fl_Color i) {
Fl_Graphics_Driver::color(i);
Fl_XMap &xmap = fl_xmap[i];
int tw = line_width_ ? line_width_ : int(scale_); if (!tw) tw = 1;
- if (!xmap.pen
-#ifdef FLTK_HIDPI_SUPPORT
- || xmap.pwidth != tw
-#endif
- ) {
+ if (!xmap.pen || xmap.pwidth != tw) {
#if USE_COLORMAP
if (fl_palette) {
set_xmap(xmap, PALETTEINDEX(i), tw);
@@ -126,11 +120,7 @@ void Fl_GDI_Graphics_Driver::color(uchar r, uchar g, uchar b) {
COLORREF c = RGB(r,g,b);
Fl_Graphics_Driver::color( fl_rgb_color(r, g, b) );
int tw = line_width_ ? line_width_ : int(scale_); if (!tw) tw = 1;
- if (!xmap.pen || c != xmap.rgb
-#ifdef FLTK_HIDPI_SUPPORT
- || tw != xmap.pwidth
-#endif
- ) {
+ if (!xmap.pen || c != xmap.rgb || tw != xmap.pwidth) {
clear_xmap(xmap);
set_xmap(xmap, c, tw);
}