Author: jpobst
Date: 2007-03-28 13:04:10 -0500 (Wed, 28 Mar 2007)
New Revision: 75094

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
Log:
2007-03-28  Jonathan Pobst  <[EMAIL PROTECTED]>

        * Control.cs, Form.cs: Anywhere we call CreateHandle, we need to do
        the check for IsHandleCreated first.  The check in CreateHandle is not
        good enough because CreateHandle can be overriden, and the override 
        should not be called if the handle is already created.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-28 17:52:59 UTC (rev 75093)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-28 18:04:10 UTC (rev 75094)
@@ -1,5 +1,12 @@
 2007-03-28  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * Control.cs, Form.cs: Anywhere we call CreateHandle, we need to do
+       the check for IsHandleCreated first.  The check in CreateHandle is not
+       good enough because CreateHandle can be overriden, and the override 
+       should not be called if the handle is already created.
+
+2007-03-28  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * ToolStrip.cs: Remove MonoTODO for tooltips.
        * ToolStripComboBox.cs: Fix MonoTODO for DropDownHeight and events.
        * ToolStripContainer.cs: Add custom ControlCollection 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-03-28 17:52:59 UTC (rev 75093)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-03-28 18:04:10 UTC (rev 75094)
@@ -3396,7 +3396,8 @@
                public Control GetChildAtPoint(Point pt) {
                        // MS's version causes the handle to be created.  The 
stack trace shows that get_Handle is called here, but
                        // we'll just call CreateHandle instead.
-                       CreateHandle ();
+                       if (!IsHandleCreated)
+                               CreateHandle ();
                        
                        // Microsoft's version of this function doesn't seem to 
work, so I can't check
                        // if we only consider children or also grandchildren, 
etc.
@@ -3913,7 +3914,8 @@
 
                protected virtual bool IsInputChar (char charCode) {
                        // XXX on MS.NET this method causes the handle to be 
created..
-                       CreateHandle ();
+                       if (!IsHandleCreated)
+                               CreateHandle ();
 
                        return true;
                }
@@ -4281,7 +4283,8 @@
                                }
                        } else {
                                // XXX MS.NET causes handle to be created here
-                               CreateHandle ();
+                               if (!IsHandleCreated)
+                                       CreateHandle ();
                        }
                        is_toplevel = value;
                }

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-03-28 17:52:59 UTC (rev 75093)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-03-28 18:04:10 UTC (rev 75094)
@@ -211,7 +211,8 @@
                {
                        if (IsMdiChild) {
                                // MS always creates handles when Focus () is 
called for mdi clients.
-                               CreateHandle ();
+                               if (!IsHandleCreated)
+                                       CreateHandle ();
                        } 
                        return base.FocusInternal (skip_check);
                }
@@ -1584,7 +1585,8 @@
 
                        // MS creates the handle here.
                        if (TopLevel) {
-                               CreateHandle ();
+                               if (!IsHandleCreated)
+                                       CreateHandle ();
                        }
                        
                        if (Width > 0) {
@@ -1618,7 +1620,8 @@
 
                        // MS creates the handle here.
                        if (TopLevel) {
-                               CreateHandle ();
+                               if (!IsHandleCreated)
+                                       CreateHandle ();
                        }
                        
                        if (Width > 0) {
@@ -2006,7 +2009,8 @@
 
                        // MS causes the handle to be created here.
                        if (!IsHandleCreated)
-                               CreateHandle ();
+                               if (!IsHandleCreated)
+                                       CreateHandle ();
                        
                        if (directed) {
                                base.SelectNextControl(null, forward, true, 
true, true);

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

Reply via email to