Author: rolf
Date: 2007-05-04 06:59:10 -0400 (Fri, 04 May 2007)
New Revision: 76666

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Log:
* XplatUIX11.cs: Add a TranslateWindowSizeToXWindowSize overload that
  takes a size parameter, since the CreateParam's size isn't true for
  minimized forms. Fixes #81518,

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-04 10:58:11 UTC (rev 76665)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-04 10:59:10 UTC (rev 76666)
@@ -1,5 +1,11 @@
 2007-05-04  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
+       * XplatUIX11.cs: Add a TranslateWindowSizeToXWindowSize overload that
+         takes a size parameter, since the CreateParam's size isn't true for
+         minimized forms. Fixes #81518,
+
+2007-05-04  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
        * Form.cs: Add OnDeactivateInternal.
        * MdiClient.cs: Raise Deactivate event. Fixes #81409.
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2007-05-04 10:58:11 UTC (rev 76665)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2007-05-04 10:59:10 UTC (rev 76666)
@@ -802,27 +802,31 @@
 
                internal static Size TranslateWindowSizeToXWindowSize 
(CreateParams cp)
                {
+                       return TranslateWindowSizeToXWindowSize (cp, new Size 
(cp.Width, cp.Height));
+               }
+
+               internal static Size TranslateWindowSizeToXWindowSize 
(CreateParams cp, Size size)
+               {
                        /* 
                         * If this is a form with no window manager, X is 
handling all the border and caption painting
                         * so remove that from the area (since the area we set 
of the window here is the part of the window 
                         * we're painting in only)
                         */
-                       Size rect = new Size (cp.Width, cp.Height);
                        Form form = cp.control as Form;
                        if (form != null && form.window_manager == null) {
                                Hwnd.Borders borders = Hwnd.GetBorders (cp, 
null);
-                               Size xrect = rect;
+                               Size xrect = size;
 
                                xrect.Width -= borders.left + borders.right;
                                xrect.Height -= borders.top + borders.bottom;
 
-                               rect = xrect;
+                               size = xrect;
                        }
-                       if (rect.Height == 0)
-                               rect.Height = 1;
-                       if (rect.Width == 0)
-                               rect.Width = 1;
-                       return rect;
+                       if (size.Height == 0)
+                               size.Height = 1;
+                       if (size.Width == 0)
+                               size.Width = 1;
+                       return size;
                }
 
                internal static Size TranslateXWindowSizeToWindowSize 
(CreateParams cp, int xWidth, int xHeight)
@@ -5351,7 +5355,7 @@
 
                                lock (XlibLock) {
                                        Control ctrl = Control.FromHandle 
(handle);
-                                       Size TranslatedSize = 
TranslateWindowSizeToXWindowSize (ctrl.GetCreateParams ());
+                                       Size TranslatedSize = 
TranslateWindowSizeToXWindowSize (ctrl.GetCreateParams (), new Size (width, 
height));
                                        XMoveResizeWindow (DisplayHandle, 
hwnd.whole_window, x, y, TranslatedSize.Width, TranslatedSize.Height);
                                        PerformNCCalc(hwnd);
                                }

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

Reply via email to