2009-03-18 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Wed, 18 Mar 2009 14:46:47 +0000 (14:46 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Wed, 18 Mar 2009 14:46:47 +0000 (14:46 -0000)
* XplatUICarbon.cs: Commit patch from Alex Shulgin that fixes window
placement of popup windows on OSX.

svn path=/trunk/mcs/; revision=129699

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs

index 6c8bcf3f91a4f114cf0aff55418feb5ac2a71612..90111613a118d5bfb2837ee15f43b9871aefc9be 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-18  Jonathan Pobst  <monkey@jpobst.com>
+
+       * XplatUICarbon.cs: Commit patch from Alex Shulgin that fixes window
+       placement of popup windows on OSX.
+
 2009-03-18  Matt Guo  <matt@mattguo.com>
 
        * FontDialog.cs: Override "ToString" for FontDialog.ColorComboBox.ColorComboBoxItem
index f157744f8d672fb6f46baaba96c695bc2f328a61..fb44a43f850f9a4cad1cb4f82b9f3105e54a6a33 100644 (file)
@@ -1912,11 +1912,16 @@ namespace System.Windows.Forms {
                                SendMessage(hwnd.client_window, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero);
 
                                Control ctrl = Control.FromHandle (handle);
-                               Size TranslatedSize = TranslateWindowSizeToQuartzWindowSize (ctrl.GetCreateParams (), new Size (width, height));
+                               CreateParams cp = ctrl.GetCreateParams ();
+                               Size TranslatedSize = TranslateWindowSizeToQuartzWindowSize (cp, new Size (width, height));
                                Carbon.Rect rect = new Carbon.Rect ();
 
                                if (WindowMapping [hwnd.Handle] != null) {
-                                       SetRect (ref rect, (short)x, (short)(y+MenuBarHeight), (short)(x+TranslatedSize.Width), (short)(y+MenuBarHeight+TranslatedSize.Height));
+                                       if (StyleSet (cp.Style, WindowStyles.WS_POPUP)) {
+                                               SetRect (ref rect, (short)x, (short)y, (short)(x+TranslatedSize.Width), (short)(y+TranslatedSize.Height));
+                                       } else {
+                                               SetRect (ref rect, (short)x, (short)(y+MenuBarHeight), (short)(x+TranslatedSize.Width), (short)(y+MenuBarHeight+TranslatedSize.Height));
+                                       }
                                        SetWindowBounds ((IntPtr) WindowMapping [hwnd.Handle], 33, ref rect);
                                        Carbon.HIRect frame_rect = new Carbon.HIRect (0, 0, TranslatedSize.Width, TranslatedSize.Height);
                                        HIViewSetFrame (hwnd.whole_window, ref frame_rect);