Author: manolo
Date: 2012-12-20 08:00:04 -0800 (Thu, 20 Dec 2012)
New Revision: 9772
Log:
Mac OS text input: corrected minor issue when text widget is in a subwindow 
(cont'd).

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-20 15:46:41 UTC (rev 9771)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2012-12-20 16:00:04 UTC (rev 9772)
@@ -2004,9 +2004,9 @@
   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 @@
       }
     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();
   }

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to