Author: andreia
Date: 2008-02-15 08:44:57 -0500 (Fri, 15 Feb 2008)
New Revision: 95750

Modified:
   
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SendKeys.cs
   
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Log:
[Backport to 1.9]
* XplatUIX11.cs: If the handle is null when posting a message, use the
current thread queue to post instead.
[Fixes #332409]

* SendKeys.cs: Slight optimization

2008-02-15  Andreia Gaita <[EMAIL PROTECTED]>

Modified: 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
    2008-02-15 13:34:24 UTC (rev 95749)
+++ 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
    2008-02-15 13:44:57 UTC (rev 95750)
@@ -1,3 +1,11 @@
+2008-02-15  Andreia Gaita <[EMAIL PROTECTED]>
+       [Backport to 1.9]
+       * XplatUIX11.cs: If the handle is null when posting a message, use the
+       current thread queue to post instead.
+       [Fixes #332409]
+
+       * SendKeys.cs: Slight optimization
+
 2008-02-14  Ivan N. Zlatev  <[EMAIL PROTECTED]>
 
        [Backport to 1.9]

Modified: 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SendKeys.cs
===================================================================
--- 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SendKeys.cs
  2008-02-15 13:34:24 UTC (rev 95749)
+++ 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SendKeys.cs
  2008-02-15 13:44:57 UTC (rev 95750)
@@ -305,9 +305,10 @@
                }
 
                private static void SendInput() {
-                       IntPtr hwnd = IntPtr.Zero;
-                       if (XplatUI.GetActive () != IntPtr.Zero) {
-                               Form active = ((Form) Control.FromHandle 
(XplatUI.GetActive ()));
+                       IntPtr hwnd = XplatUI.GetActive ();
+                       
+                       if (hwnd != IntPtr.Zero) {
+                               Form active = ((Form) Control.FromHandle 
(hwnd));
                                if (active != null && active.ActiveControl != 
null)
                                        hwnd = active.ActiveControl.Handle;
                                else if (active != null)

Modified: 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
        2008-02-15 13:34:24 UTC (rev 95749)
+++ 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
        2008-02-15 13:44:57 UTC (rev 95750)
@@ -4672,7 +4672,10 @@
                        xevent.ClientMessageEvent.ptr3 = wparam;
                        xevent.ClientMessageEvent.ptr4 = lparam;
 
-                       hwnd.Queue.EnqueueLocked (xevent);
+                       if (hwnd != null)
+                               hwnd.Queue.EnqueueLocked (xevent);
+                       else
+                               ThreadQueue(Thread.CurrentThread).EnqueueLocked 
(xevent);
 
                        return true;
                }

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

Reply via email to