Author: manolo
Date: 2011-11-22 09:24:51 -0800 (Tue, 22 Nov 2011)
New Revision: 9184
Log:
Propagated changes from 1.3

Modified:
   branches/branch-3.0/src/fltk3/Menu.cxx
   branches/branch-3.0/src/fltk3/cocoa.mm

Modified: branches/branch-3.0/src/fltk3/Menu.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Menu.cxx      2011-11-22 16:58:19 UTC (rev 
9183)
+++ branches/branch-3.0/src/fltk3/Menu.cxx      2011-11-22 17:24:51 UTC (rev 
9184)
@@ -363,7 +363,7 @@
   if (Wp > W) W = Wp;
   if (Wtitle > W) W = Wtitle;
 
-  if (X < scr_x) X = scr_x; if (X > scr_x+scr_w-W) X = right_edge-W; //X= 
scr_x+scr_w-W;
+  if (X < scr_x) X = scr_x; if (X > scr_x+scr_w-W) X = right_edge-W;
   x(X); w(W);
   h((numitems ? itemheight*numitems-LEADING : 0)+2*BW+3);
   if (selected >= 0) {
@@ -943,7 +943,8 @@
        // delete all the old menus and create new one:
        while (pp.nummenus > pp.menu_number+1) delete pp.p[--pp.nummenus];
        pp.p[pp.nummenus++]= new menuwindow(menutable, nX, nY,
-                                         title?1:0, 0, 0, title, 0, menubar, 
cw.x());
+                                         title?1:0, 0, 0, title, 0, menubar, 
+                                           (title ? 0 : cw.x()) );
       }
     } else { // !m->submenu():
       while (pp.nummenus > pp.menu_number+1) delete pp.p[--pp.nummenus];

Modified: branches/branch-3.0/src/fltk3/cocoa.mm
===================================================================
--- branches/branch-3.0/src/fltk3/cocoa.mm      2011-11-22 16:58:19 UTC (rev 
9183)
+++ branches/branch-3.0/src/fltk3/cocoa.mm      2011-11-22 17:24:51 UTC (rev 
9184)
@@ -591,10 +591,12 @@
 - (BOOL)windowShouldClose:(FLWindow *)fl
 {
   fl_lock_function();
-  fltk3::handle( fltk3::CLOSE, [fl getFl_Window] ); // this might or might not 
close the window
+  fltk3::Window *to_close = [fl getFl_Window];
+  fltk3::handle( fltk3::CLOSE, to_close ); // this might or might not close 
the window
+  fltk3::do_widget_deletion();
   if (!Fl_X::first) return YES;
   fltk3::Window *l = fltk3::first_window();
-  while( l != NULL && l != [fl getFl_Window]) l = fltk3::next_window(l);
+  while( l != NULL && l != to_close) l = fltk3::next_window(l);
   fl_unlock_function();
   return (l == NULL ? YES : NO);
 }
@@ -938,6 +940,7 @@
   pt.y = [[nsw contentView] frame].size.height;
   pt2 = [nsw convertBaseToScreen:pt];
   update_e_xy_and_e_xy_root(nsw);
+  resize_from_system = window;
   window->position((int)pt2.x, (int)(main_screen_height - pt2.y));
   if ([nsw containsGLsubwindow] ) {
     [nsw display];// redraw window after moving if it contains OpenGL 
subwindows
@@ -1027,6 +1030,7 @@
   while ( Fl_X::first ) {
     Fl_X *x = Fl_X::first;
     fltk3::handle( fltk3::CLOSE, x->w );
+    fltk3::do_widget_deletion();
     if ( Fl_X::first == x ) {
       reply = NSTerminateCancel; // FLTK has not closed all windows, so we 
return to the main program now
       break;
@@ -2238,13 +2242,14 @@
       dim.origin.y = main_screen_height - (Y + H);
       dim.size.width = W;
       dim.size.height = H + bt;
-      [i->xid setFrame:dim display:YES];
+      [i->xid setFrame:dim display:YES]; // calls windowDidResize
     } else {
       NSPoint pt; 
       pt.x = X; 
       pt.y = main_screen_height - (Y + h());
-      [i->xid setFrameOrigin:pt];
+      [i->xid setFrameOrigin:pt]; // calls windowDidMove
     }
+    return;
   }
   resize_from_system = 0;
   if (is_a_resize) {

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

Reply via email to