FLTK logo

[master] fae9f03 - X11 platform: account for GUI scaling in location of input method aux window.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] fae9f03 - X11 platform: account for GUI scaling in location of input method aux window. "ManoloFLTK" Dec 12, 2021  
 
commit fae9f03cc91fc1cf9649fb18a34671c9774ce716
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sun Dec 12 16:29:37 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sun Dec 12 16:29:48 2021 +0100

    X11 platform: account for GUI scaling in location of input method aux window.

 src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
index a966825..1c6c2a6 100644
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
@@ -174,9 +174,11 @@ void Fl_Xlib_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W,
   if (fnt && must_free_fnt) free(fnt);
   if (!change) return;
 
-
+  float s = scale();
+  XRectangle fl_spot_unscaled = { short(fl_spot.x * s), short(fl_spot.y * s),
+    (unsigned short)(fl_spot.width * s), (unsigned short)(fl_spot.height * s) };
   preedit_attr = XVaCreateNestedList(0,
-                                     XNSpotLocation, &fl_spot,
+                                     XNSpotLocation, &fl_spot_unscaled,
                                      XNFontSet, fs, NULL);
   XSetICValues(fl_xim_ic, XNPreeditAttributes, preedit_attr, NULL);
   XFree(preedit_attr);
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.