Author: everaldo
Date: 2008-01-23 18:04:09 -0500 (Wed, 23 Jan 2008)
New Revision: 93733

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
Log:
        * MenuAPI.cs: When FindForm fails uses FindRootParent to find the 
control to
        be used as grab_control. Also save status of capture before show 
ContextMenu
        and restore it after close.

2008-01-23  Everaldo Canuto  <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-23 22:55:46 UTC (rev 93732)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-23 23:04:09 UTC (rev 93733)
@@ -1,5 +1,11 @@
 2008-01-23  Everaldo Canuto  <[EMAIL PROTECTED]>
 
+       * MenuAPI.cs: When FindForm fails uses FindRootParent to find the 
control to
+       be used as grab_control. Also save status of capture before show 
ContextMenu
+       and restore it after close.
+
+2008-01-23  Everaldo Canuto  <[EMAIL PROTECTED]>
+
        * Control.cs: Internal FindRootParent method added to return high 
control
        in parent tree.
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2008-01-23 22:55:46 UTC (rev 93732)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2008-01-23 23:04:09 UTC (rev 93733)
@@ -56,11 +56,11 @@
        
                                Control source_control = (top_menu as 
ContextMenu).SourceControl;
                                grab_control = source_control.FindForm ();
-
                                if (grab_control == null)
-                                       grab_control = source_control;
+                                       grab_control = 
source_control.FindRootParent ();
 
                                grab_control.ActiveTracker = this;
+
                        } else
                                grab_control = top_menu.Wnd.FindForm ();
                }
@@ -273,12 +273,18 @@
 
                        queue_id = XplatUI.StartLoop(Thread.CurrentThread);
 
+                       // Save result of capture status.
+                       bool captured = tracker.grab_control.Capture;
+                       
                        while ((menu.Wnd != null) && menu.Wnd.Visible && 
no_quit) {
                                MSG msg = new MSG ();
                                no_quit = XplatUI.GetMessage(queue_id, ref msg, 
IntPtr.Zero, 0, 0);
                                XplatUI.TranslateMessage(ref msg);
                                XplatUI.DispatchMessage(ref msg);               
                
                        }
+                       
+                       if (captured)
+                               tracker.grab_control.Capture = true;
 
                        if (!no_quit)
                                XplatUI.PostQuitMessage(0);

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

Reply via email to