diff options
| author | Manolo Gouy <Manolo> | 2012-12-20 15:12:32 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2012-12-20 15:12:32 +0000 |
| commit | 4ab7e91c61f0d304c1d3154f4228c07b3dc1c5fc (patch) | |
| tree | ab655998759bf4a066aa1af4b58afd9c979e8f78 /src | |
| parent | 70ea6b8d7c34b6c8bcf1ef324db3324ee66791ab (diff) | |
Mac OS text input: corrected minor issue when text widget is in a subwindow.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9770 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 09da25617..a964f10a8 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2012,10 +2012,21 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi glyphRect.origin.y = (CGFloat)y + current->textsize(); glyphRect.size.height = current->textsize(); } else { - glyphRect.origin.x = focus->x(); - glyphRect.origin.y = focus->y() + focus->h(); + if (focus->as_window()) { + glyphRect.origin.x = 0; + glyphRect.origin.y = focus->h(); + } + else { + glyphRect.origin.x = focus->x(); + glyphRect.origin.y = focus->y() + focus->h(); + } glyphRect.size.height = 12; } + Fl_Window *win = focus->window(); + while (win != NULL && win != wfocus) { + glyphRect.origin.y += win->y(); + win = win->window(); + } // Convert the rect to screen coordinates glyphRect.origin.y = wfocus->h() - glyphRect.origin.y; glyphRect.origin = [[self window] convertBaseToScreen:glyphRect.origin]; |
