summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Input_.cxx4
-rw-r--r--src/Fl_mac.cxx2
-rw-r--r--src/Fl_win32.cxx30
-rw-r--r--src/Fl_x.cxx12
4 files changed, 21 insertions, 27 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 199a594e7..e5174add0 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -353,7 +353,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
fl_pop_clip();
if (Fl::focus() == this) {
fl_set_spot(textfont(), textsize(),
- (int)xpos+curx, Y+ypos-fl_descent(), W, H);
+ (int)xpos+curx, Y+ypos-fl_descent(), W, H, window());
}
}
@@ -794,7 +794,7 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
return 1;
case FL_FOCUS:
- fl_set_spot(textfont(), textsize(), x(), y(), w(), h());
+ fl_set_spot(textfont(), textsize(), x(), y(), w(), h(), window());
if (mark_ == position_) {
minimal_update(size()+1);
} else //if (Fl::selection_owner() != this)
diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx
index eb239a0c2..d97d3b644 100644
--- a/src/Fl_mac.cxx
+++ b/src/Fl_mac.cxx
@@ -127,7 +127,7 @@ void fl_reset_spot()
{
}
-void fl_set_spot(int font, int size, int x, int y, int w, int h)
+void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win)
{
}
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 1aa82c175..06ada4884 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -250,29 +250,23 @@ void fl_reset_spot()
{
}
-void fl_set_spot(int font, int size, int x, int y, int w, int h)
+void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win)
{
- get_imm_module();
- HIMC himc = flImmGetContext(fl_msg.hwnd);
- if (himc) {
- Fl_Window* w = fl_find(fl_msg.hwnd);
-
- // FIXME: the following is a temporary fix for STR #2101
- if (!w) {
- flImmReleaseContext(fl_msg.hwnd, himc);
- return;
- }
+ if (!win) return;
+ Fl_Window* tw = win;
+ while (tw->parent()) tw = tw->window(); // find top level window
- while (w->parent()) w = w->window();
+ get_imm_module();
+ HIMC himc = flImmGetContext(fl_xid(tw));
- COMPOSITIONFORM cfs;
+ if (himc) {
+ COMPOSITIONFORM cfs;
cfs.dwStyle = CFS_POINT;
- cfs.ptCurrentPos.x = x;
- cfs.ptCurrentPos.y = y - w->labelsize();
- MapWindowPoints(fl_msg.hwnd, fl_xid(w), &cfs.ptCurrentPos, 1);
+ cfs.ptCurrentPos.x = X;
+ cfs.ptCurrentPos.y = Y - tw->labelsize();
+ MapWindowPoints(fl_xid(win), fl_xid(tw), &cfs.ptCurrentPos, 1);
flImmSetCompositionWindow(himc, &cfs);
-
- flImmReleaseContext(fl_msg.hwnd, himc);
+ flImmReleaseContext(fl_xid(tw), himc);
}
}
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 4198b5015..b18aa7707 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -422,7 +422,7 @@ void fl_reset_spot(void)
//if (fl_xim_ic) XUnsetICFocus(fl_xim_ic);
}
-void fl_set_spot(int font, int size, int x, int y, int w, int h)
+void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win)
{
int change = 0;
XVaNestedList preedit_attr;
@@ -435,11 +435,11 @@ void fl_set_spot(int font, int size, int x, int y, int w, int h)
if (!fl_xim_ic || !fl_is_over_the_spot) return;
//XSetICFocus(fl_xim_ic);
- if (x != spot.x || y != spot.y) {
- spot.x = x;
- spot.y = y;
- spot.height = h;
- spot.width = w;
+ if (X != spot.x || Y != spot.y) {
+ spot.x = X;
+ spot.y = Y;
+ spot.height = H;
+ spot.width = W;
change = 1;
}
if (font != spotf || size != spots) {