summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-14 16:06:25 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-14 16:06:25 +0100
commitf76e579ffec32aaf1095d37aaf4a54780fd20b6c (patch)
treed97b7c45228c9099122ac5cb8b1ee158a483fa26
parent81d07af93a4ace78c0c6abfd912fc0a509dbfcec (diff)
Windows platform and Input Methods: improve GUI scaling support.
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index e32d1ae35..07985d3d9 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -21,6 +21,7 @@
#include <FL/platform.H>
#include <FL/fl_draw.H>
#include "../../Fl_Screen_Driver.H"
+#include "Fl_Font.H"
#if USE_GDIPLUS
static ULONG_PTR gdiplusToken = 0;
@@ -272,6 +273,9 @@ void Fl_GDI_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, i
cfs.dwStyle = CFS_POINT;
cfs.ptCurrentPos.x = X * s;
cfs.ptCurrentPos.y = int(Y * s) - int(tw->labelsize() * s);
+ // Attempt to have temporary text entered by input method use scaled font.
+ // Does good, but still not always effective.
+ SelectObject((HDC)gc(), ((Fl_GDI_Font_Descriptor*)font_descriptor())->fid);
MapWindowPoints(fl_xid(win), fl_xid(tw), &cfs.ptCurrentPos, 1);
flImmSetCompositionWindow(himc, &cfs);
flImmReleaseContext(fl_xid(tw), himc);