Author: rolf
Date: 2007-03-27 10:23:11 -0500 (Tue, 27 Mar 2007)
New Revision: 75024
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Log:
* XplatUIX11.cs: Windows without WS_CAPTION can still get decorations
(at least borders). Fixes #79386 on Linux (with a small difference
in behaviour: when trying to resize a caption-less window metacity
shows the sysmenu. Resizing is still possible though).
* XplatUIWin32.cs: When setting window styles send request an extra
WM_NCCALCSIZE when it's a form without title (due to no text and no
caption), since Win32 seems to calculate it wrong the first time we
get the message, though the second time things work as they should.
* Form.cs: Reorder a few statements in ChangingParent, otherwise the
newly reparented window might show up unparented. Update
CreateParams to exclude WS_DLGFRAME if ControlBox is false and
there's no title text. Fixes #79386.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-27 15:12:58 UTC (rev 75023)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-27 15:23:11 UTC (rev 75024)
@@ -1,3 +1,18 @@
+2007-03-27 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * XplatUIX11.cs: Windows without WS_CAPTION can still get decorations
+ (at least borders). Fixes #79386 on Linux (with a small difference
+ in behaviour: when trying to resize a caption-less window metacity
+ shows the sysmenu. Resizing is still possible though).
+ * XplatUIWin32.cs: When setting window styles send request an extra
+ WM_NCCALCSIZE when it's a form without title (due to no text and no
+ caption), since Win32 seems to calculate it wrong the first time we
+ get the message, though the second time things work as they should.
+ * Form.cs: Reorder a few statements in ChangingParent, otherwise the
+ newly reparented window might show up unparented. Update
+ CreateParams to exclude WS_DLGFRAME if ControlBox is false and
+ there's no title text. Fixes #79386.
+
2007-03-27 Mike Kestner <[EMAIL PROTECTED]>
* ListBox.cs : don't perform invalidations if the handle hasn't been
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2007-03-27 15:12:58 UTC (rev 75023)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2007-03-27 15:23:11 UTC (rev 75024)
@@ -196,10 +196,10 @@
} else if (new_parent is MdiClient) {
window_manager = new MdiWindowManager (this,
(MdiClient) new_parent);
} else {
- window_manager = new FormWindowManager (this);
if (IsHandleCreated) {
- XplatUI.SetWindowStyle (Handle,
CreateParams);
+ RecreateHandle
();//XplatUI.SetWindowStyle (Handle, CreateParams);
}
+ window_manager = new FormWindowManager (this);
}
if (window_manager != null) {
@@ -1273,6 +1273,10 @@
cp.Style |=
(int)(WindowStyles.WS_DISABLED);
}
+ if (!ControlBox && Text == string.Empty) {
+ cp.WindowStyle &=
~WindowStyles.WS_DLGFRAME;
+ }
+
return cp;
}
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
2007-03-27 15:12:58 UTC (rev 75023)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
2007-03-27 15:23:11 UTC (rev 75024)
@@ -42,7 +42,7 @@
WS_CLIPSIBLINGS = 0x04000000,
WS_CLIPCHILDREN = 0x02000000,
WS_MAXIMIZE = 0x01000000,
- WS_CAPTION = 0x00C00000,
+ WS_CAPTION = 0x00C00000, // == WS_BORDER |
WS_DLGFRAME
WS_BORDER = 0x00800000,
WS_DLGFRAME = 0x00400000,
WS_VSCROLL = 0x00200000,
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
2007-03-27 15:12:58 UTC (rev 75023)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
2007-03-27 15:23:11 UTC (rev 75024)
@@ -1359,7 +1359,8 @@
Win32SetWindowLong(handle, WindowLong.GWL_STYLE,
(uint)cp.Style);
Win32SetWindowLong(handle, WindowLong.GWL_EXSTYLE,
(uint)cp.ExStyle);
- if ((cp.ExStyle & (int)
WindowExStyles.WS_EX_TOOLWINDOW) > 0)
+ if ((cp.ExStyle & (int)
WindowExStyles.WS_EX_TOOLWINDOW) > 0 ||
+ ((cp.WindowStyle & (WindowStyles.WS_CAPTION))
!= WindowStyles.WS_CAPTION && cp.control is Form))
XplatUI.RequestNCRecalc (handle);
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
2007-03-27 15:12:58 UTC (rev 75023)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
2007-03-27 15:23:11 UTC (rev 75024)
@@ -869,12 +869,9 @@
mwmHints.functions = (IntPtr)0;
mwmHints.decorations = (IntPtr)0;
- if (ExStyleSet (cp.ExStyle,
WindowExStyles.WS_EX_TOOLWINDOW)
- || !StyleSet (cp.Style, WindowStyles.WS_CAPTION |
WindowStyles.WS_BORDER | WindowStyles.WS_DLGFRAME)) {
+ if (ExStyleSet (cp.ExStyle,
WindowExStyles.WS_EX_TOOLWINDOW)) {
/* tool windows get no window manager
- decorations, and neither do windows
- which lack CAPTION/BORDER/DLGFRAME
- styles.
+ decorations.
*/
/* just because the window doesn't get any
decorations doesn't
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches