summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2008-12-05 13:48:26 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2008-12-05 13:48:26 +0000
commitabfba160407394e25026af8546504ebd22c5b688 (patch)
treed1b89cd1e0bf0d7ffe122b8c959d346edb65cc84 /src
parent60335167b2219666985f4f948b8654642473c764 (diff)
STR 2101: Temporary fix to prevent crash. Also corrected code indentation.
ToDo: The correct fix would need more code changes and is under investigation. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6543 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
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)