summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_win32.cxx38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 97adb5cf2..aef124d65 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -227,22 +227,28 @@ void fl_reset_spot()
void fl_set_spot(int font, int size, int x, int y, int w, int h)
{
- get_imm_module();
- HIMC himc = flImmGetContext(fl_msg.hwnd);
- if (himc) {
- Fl_Window* w = fl_find(fl_msg.hwnd);
-
- while (w->parent()) w = w->window();
-
- 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);
- flImmSetCompositionWindow(himc, &cfs);
-
- flImmReleaseContext(fl_msg.hwnd, himc);
- }
+ 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;
+ }
+
+ while (w->parent()) w = w->window();
+
+ 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);
+ flImmSetCompositionWindow(himc, &cfs);
+
+ flImmReleaseContext(fl_msg.hwnd, himc);
+ }
}
void fl_set_status(int x, int y, int w, int h)