Alex Shulgin wrote:
Jonathan Pobst wrote:
I committed the less risky parts of this, hopefully it will fix your issues.

Hi,

It's me again.


Thanks for your support last time! However, my issue is not resolved yet...

I've tried your patch on Mac OS and it works correctly there too. But there's another problem: when trying to resize the control displayed in the drop down, the popup window is first moved some pixels down. This is unwanted behavior.

This happens only on Mac OS and not on Linux or Windows.

OK, I think I've located the problem. :)

Please review the attached patch to see if it's OK.

I'm adjusting XplatUICarbon.SetWindowPos in analogy with CreateWindow method where the check for WS_POPUP style is used for correct initial window placement.

This fixes things for me. I'll try to run tests on Mac when I manage to compile mono on Mac box. However, I believe this patch is fairly safe and doesn't break anything as far as I can see.

I'm waiting for your answer and hope this patch can be committed soon. :)

--
Regards,
Alex
PS: sorry for weird formatting in my last message--this happens from time to time when you edit a file in 3 different editors on two machines. :)

Index: XplatUICarbon.cs
===================================================================
--- XplatUICarbon.cs	(revision 129450)
+++ XplatUICarbon.cs	(working copy)
@@ -1912,11 +1912,16 @@
 				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);
_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to