Author: spitzak
Date: 2007-06-15 16:40:45 -0400 (Fri, 15 Jun 2007)
New Revision: 5907
Log:
Further fixes to the bugs on OSX. This time for sure...


Modified:
   trunk/src/Window.cxx
   trunk/src/osx/run.cxx
   trunk/src/x11/run.cxx

Modified: trunk/src/Window.cxx
===================================================================
--- trunk/src/Window.cxx        2007-06-15 20:39:57 UTC (rev 5906)
+++ trunk/src/Window.cxx        2007-06-15 20:40:45 UTC (rev 5907)
@@ -132,10 +132,14 @@
 /*! This constructor is for \e child windows. You should use the
   constructor with just W and H for normal parent windows. This
   constructor leaves visible() true, so the child window will appear
-  when the parent window has show() called. */
+  when the parent window has show() called. WARNING: this is misleading
+  if this is *not* a child window, call clear_visible() for top-level
+  ones.
+*/
 Window::Window(int X,int Y,int W, int H, const char *l, bool begin)
 : Group(X, Y, W, H, l, begin) {
   _Window();
+  // if (!parent()) clear_visible(); // this breaks the popup menus
 }
 
 /*! This form of the constructor should be used for a "top-level"
@@ -822,19 +826,16 @@
   i = 0;
 
   // remove from the list of windows:
-  CreatedWindow** pp = &CreatedWindow::first;
 #if USE_QUARTZ
   // remove child/brother pointers as well...
-  for (; *pp; pp = &(*pp)->next) {
-    if ((*pp)->children == x) (*pp)->children = x->brother;
-    if ((*pp)->brother == x) (*pp)->brother = x->brother;
-    if (*pp == x) {
-      *pp = x->next;
-      if(!*pp)
-        break;
-    }
+  if (CreatedWindow::first == x) CreatedWindow::first = x->next;
+  for (CreatedWindow* w = CreatedWindow::first; w; w = w->next) {
+    if (w->children == x) w->children = x->brother;
+    if (w->brother == x) w->brother = x->brother;
+    if (w->next == x) w->next = x->next;
   }
 #else
+  CreatedWindow** pp = &CreatedWindow::first;
   for (; *pp != x; pp = &(*pp)->next) if (!*pp) return;
   *pp = x->next;
 #endif

Modified: trunk/src/osx/run.cxx
===================================================================
--- trunk/src/osx/run.cxx       2007-06-15 20:39:57 UTC (rev 5906)
+++ trunk/src/osx/run.cxx       2007-06-15 20:40:45 UTC (rev 5907)
@@ -602,8 +602,10 @@
     ret = eventNotHandledErr; // without this it blocks until mouse moves?
     break;
   case kEventWindowDeactivated:
-    handle(LEAVE, 0); // temporary fix until we get real enter/leave events
-    if ( window == xfocus ) fix_xfocus(0);
+    if ( window == xfocus ) {
+      handle(LEAVE, 0); // temporary fix until we get real enter/leave events
+      fix_xfocus(0);
+    }
     ret = eventNotHandledErr;
     break;
   case kEventWindowClose:

Modified: trunk/src/x11/run.cxx
===================================================================
--- trunk/src/x11/run.cxx       2007-06-15 20:39:57 UTC (rev 5906)
+++ trunk/src/x11/run.cxx       2007-06-15 20:40:45 UTC (rev 5907)
@@ -1434,6 +1434,7 @@
     Rectangle& current = CreatedWindow::find(window)->current_size;
     if (X != current.x() || Y != current.y() || W != current.w() || H != 
current.h()) {
       window->resize(X, Y, W, H);
+      window->layout_damage( window->layout_damage() | LAYOUT_USER );
     }
     current.set(X,Y,W,H);
     break;}

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

Reply via email to