FLTK logo

[master] 9164e3c - Text input method for X11: fix for case when text widget is inside subwindow.

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] 9164e3c - Text input method for X11: fix for case when text widget is inside subwindow. "ManoloFLTK" Jan 02, 2022  
 
commit 9164e3c48973a2a07bcb82a2bfff1a50a532e69e
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sun Jan 2 17:44:55 2022 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sun Jan 2 17:44:55 2022 +0100

    Text input method for X11: fix for case when text widget is inside subwindow.

 src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
index 1c6c2a6..14c56c0 100644
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
@@ -134,6 +134,13 @@ void Fl_Xlib_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W,
   static XIC ic = NULL;
 
   if (!fl_xim_ic || !fl_is_over_the_spot) return;
+  if (Fl::focus()) { // handle case when text widget is inside subwindow
+    Fl_Window *focuswin = Fl::focus()->window();
+    while (focuswin && focuswin->parent()) {
+      X += focuswin->x(); Y += focuswin->y();
+      focuswin = focuswin->window();
+    }
+  }
   //XSetICFocus(fl_xim_ic);
   if (X != fl_spot.x || Y != fl_spot.y) {
     fl_spot.x = X;
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'.