diff options
| author | Manolo Gouy <Manolo> | 2012-12-20 16:00:04 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2012-12-20 16:00:04 +0000 |
| commit | d7a5f3f04aa6184f674482ea0611be2ac8b2dcee (patch) | |
| tree | 6086aa7633ac3dbd17681cb4166c63b9f810685d | |
| parent | 4ab7e91c61f0d304c1d3154f4228c07b3dc1c5fc (diff) | |
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
| -rw-r--r-- | src/Fl_cocoa.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index a964f10a8..293dd80c6 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -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(); } |
