diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-13 10:39:54 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-13 10:40:05 +0100 |
| commit | 3565aa1e60833a9e547a014081af5915a2e2732b (patch) | |
| tree | 3380b41815df93e4741b93d85cad2b39618dacfd /src/drivers/GDI | |
| parent | 95d862fd5afc5e62504c45c213672ad04f3d9928 (diff) | |
Windows platform: account for GUI scaling when using input method.
Diffstat (limited to 'src/drivers/GDI')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx index 0ee5cf99f..e32d1ae35 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx @@ -259,8 +259,7 @@ extern flTypeImmReleaseContext flImmReleaseContext; void Fl_GDI_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win) { if (!win) return; - Fl_Window* tw = win; - while (tw->parent()) tw = tw->window(); // find top level window + Fl_Window* tw = win->top_window(); if (!tw->shown()) return; @@ -269,9 +268,10 @@ void Fl_GDI_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, i if (himc) { COMPOSITIONFORM cfs; + float s = scale(); cfs.dwStyle = CFS_POINT; - cfs.ptCurrentPos.x = X; - cfs.ptCurrentPos.y = Y - tw->labelsize(); + cfs.ptCurrentPos.x = X * s; + cfs.ptCurrentPos.y = int(Y * s) - int(tw->labelsize() * s); MapWindowPoints(fl_xid(win), fl_xid(tw), &cfs.ptCurrentPos, 1); flImmSetCompositionWindow(himc, &cfs); flImmReleaseContext(fl_xid(tw), himc); |
