Author: andreia
Date: 2007-12-05 21:02:52 -0500 (Wed, 05 Dec 2007)
New Revision: 90787

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
Log:
* Control.cs: When updating the zorder, ignore windows that are not
mapped. Fixes #342509

2007-12-05  Andreia Gaita <[EMAIL PROTECTED]>

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-12-06 00:42:49 UTC (rev 90786)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-12-06 02:02:52 UTC (rev 90787)
@@ -1,3 +1,8 @@
+2007-12-05  Andreia Gaita <[EMAIL PROTECTED]>
+
+       * Control.cs: When updating the zorder, ignore windows that are not
+       mapped. Fixes #342509
+
 2007-12-05  Carlos Alberto Cortez <[EMAIL PROTECTED]>
 
        * ListViewItem.cs: Actually implement serialization on this class.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-12-06 00:42:49 UTC (rev 90786)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-12-06 02:02:52 UTC (rev 90787)
@@ -4891,12 +4891,17 @@
                private void UpdateZOrderOfChild(Control child) {
                        if (IsHandleCreated && child.IsHandleCreated && 
(child.parent == this)) {
                                // Need to take into account all controls
-                               int     index;
                                Control [] all_controls = 
child_controls.GetAllControls ();
 
-                               index = Array.IndexOf (all_controls, child);
-
-                               if (index > 0) {
+                               int index = Array.IndexOf (all_controls, child);
+                               
+                               for (; index > 0; index--) {
+                                       if (!all_controls [index - 
1].IsHandleCreated || !all_controls [index - 1].VisibleInternal)
+                                               continue;
+                                       break;
+                               }
+                               
+                               if (index > 0)  {
                                        XplatUI.SetZOrder(child.Handle, 
all_controls [index - 1].Handle, false, false);
                                } else {
                                        IntPtr after = AfterTopMostControl ();

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to