Mac OS text input: corrected minor issue when text widget is in a subwindow (cont'd).

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9772 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2012-12-20 16:00:04 +00:00
parent 4ab7e91c61
commit d7a5f3f04a

View File

@ -2004,9 +2004,9 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi
if (!focus) focus = wfocus;
glyphRect.size.width = 0;
if (dynamic_cast<Fl_Text_Display*>(focus) != NULL) {
Fl_Text_Display *current = dynamic_cast<Fl_Text_Display*>(focus);
if (current) {
int x, y;
Fl_Text_Display *current = (Fl_Text_Display*)focus;
current->position_to_xy( current->insert_position(), &x, &y );
glyphRect.origin.x = (CGFloat)x;
glyphRect.origin.y = (CGFloat)y + current->textsize();
@ -2022,8 +2022,10 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi
}
glyphRect.size.height = 12;
}
Fl_Window *win = focus->window();
Fl_Window *win = focus->as_window();
if (!win) win = focus->window();
while (win != NULL && win != wfocus) {
glyphRect.origin.x += win->x();
glyphRect.origin.y += win->y();
win = win->window();
}