Author: gnorton
Date: 2008-01-23 16:08:02 -0500 (Wed, 23 Jan 2008)
New Revision: 93713

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
Log:
In System.Windows.Forms:
2008-01-23  Geoff Norton  <[EMAIL PROTECTED]>

        * XplatUICarbon.cs: Ensure that we always have a host window.  Prevents
        a crash in certain cases.  Support for fullscreen windows in certain 
cases.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-23 20:49:56 UTC (rev 93712)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-23 21:08:02 UTC (rev 93713)
@@ -1,3 +1,8 @@
+2008-01-23  Geoff Norton  <[EMAIL PROTECTED]>
+
+       * XplatUICarbon.cs: Ensure that we always have a host window.  Prevents
+       a crash in certain cases.  Support for fullscreen windows in certain 
cases.
+
 2008-01-23  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * Form.cs: Don't set AutoScaleMode in AutoScale if we don't have to.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs 
2008-01-23 20:49:56 UTC (rev 93712)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs 
2008-01-23 21:08:02 UTC (rev 93713)
@@ -955,6 +955,9 @@
                                        attributes |= 
Carbon.WindowAttributes.kWindowResizableAttribute;
                                        windowklass = 
Carbon.WindowClass.kUtilityWindowClass;
                                }
+                               if (windowklass == 
Carbon.WindowClass.kOverlayWindowClass) {
+                                       attributes = 
Carbon.WindowAttributes.kWindowCompositingAttribute | 
Carbon.WindowAttributes.kWindowStandardHandlerAttribute;
+                               }
                                attributes |= 
Carbon.WindowAttributes.kWindowLiveResizeAttribute;
 
                                Carbon.Rect rect = new Carbon.Rect ();
@@ -1890,8 +1893,9 @@
                        hwnd.height = height;
                }
                
-               internal override void SetWindowState(IntPtr hwnd, 
FormWindowState state) {
-                       IntPtr window = HIViewGetWindow (hwnd);
+               internal override void SetWindowState(IntPtr handle, 
FormWindowState state) {
+                       Hwnd hwnd = Hwnd.ObjectFromHandle (handle);
+                       IntPtr window = HIViewGetWindow (handle);
 
                        switch (state) {
                                case FormWindowState.Minimized: {
@@ -1903,7 +1907,16 @@
                                        break;
                                }
                                case FormWindowState.Maximized: {
-                                       ZoomWindow (window, 8, false);
+                                       Form form = Control.FromHandle 
(hwnd.Handle) as Form;
+                                       if (form != null && 
form.FormBorderStyle == FormBorderStyle.None) {
+                                               Carbon.Rect rect = new 
Carbon.Rect ();
+                                               Carbon.HIRect bounds = 
CGDisplayBounds (CGMainDisplayID ());
+                                               SetRect (ref rect, (short)0, 
(short)0, (short)bounds.size.width, (short)bounds.size.height);
+                                               SetWindowBounds ((IntPtr) 
WindowMapping [hwnd.Handle], 33, ref rect);
+                                               HIViewSetFrame 
(hwnd.whole_window, ref bounds);
+                                       } else {
+                                               ZoomWindow (window, 8, false);
+                                       }
                                        break;
                                }
                        }

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

Reply via email to