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
This commit is contained in:
Albrecht Schlosser
2008-12-05 13:48:26 +00:00
parent 60335167b2
commit abfba16040
+19 -13
View File
@@ -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);
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();
// FIXME: the following is a temporary fix for STR #2101
if (!w) {
flImmReleaseContext(fl_msg.hwnd, himc);
return;
}
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);
while (w->parent()) w = w->window();
flImmReleaseContext(fl_msg.hwnd, 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);
flImmSetCompositionWindow(himc, &cfs);
flImmReleaseContext(fl_msg.hwnd, himc);
}
}
void fl_set_status(int x, int y, int w, int h)