Author: manolo
Date: 2012-12-20 07:12:32 -0800 (Thu, 20 Dec 2012)
New Revision: 9770
Log:
Mac OS text input: corrected minor issue when text widget is in a subwindow.
Modified:
branches/branch-1.3/src/Fl_cocoa.mm
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2012-12-19 16:06:32 UTC (rev 9769)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2012-12-20 15:12:32 UTC (rev 9770)
@@ -2012,10 +2012,21 @@
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];
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit