From 3c5187faf3832e6252f0921e359d9f69eafb72e1 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 19 Mar 2007 11:08:52 +0000 Subject: [PATCH] 2007-03-19 Chris Toshok [ Fixes bug #80604] * XplatUIX11.cs (WaitForHwndMessage): change this to actually swallow the message we're waiting on, instead of delivering it, as this is only used for the WM_SHOWWINDOW raised from MapWindow/UnmapWindow, and the message needs to be generated (MapWindow, UnmapWindow): generate the WM_SHOWWINDOW message before doing the Map/Unmap. Also make sure that the Hwnd is still alive after the message has been handled. *before* the window is shown. * Control.cs (CreateControl): guard a few more things inside the if (!is_created) block, as we might end up being called again - yay .net. (WmShowWindow): call CreateControl if we're showing the control. svn path=/trunk/mcs/; revision=74599 --- .../System.Windows.Forms/ChangeLog | 19 +++++++++++++++ .../System.Windows.Forms/Control.cs | 11 +++++---- .../System.Windows.Forms/XplatUIX11.cs | 28 +++++++++++++++++++--- 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index f3b8b86ec6a..7b2081c1107 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,22 @@ +2007-03-19 Chris Toshok + + [ Fixes bug #80604] + + * XplatUIX11.cs (WaitForHwndMessage): change this to actually + swallow the message we're waiting on, instead of delivering it, as + this is only used for the WM_SHOWWINDOW raised from + MapWindow/UnmapWindow, and the message needs to be generated + (MapWindow, UnmapWindow): generate the WM_SHOWWINDOW message + before doing the Map/Unmap. Also make sure that the Hwnd is still + alive after the message has been handled. + + *before* the window is shown. + + * Control.cs (CreateControl): guard a few more things inside the + if (!is_created) block, as we might end up being called again - + yay .net. + (WmShowWindow): call CreateControl if we're showing the control. + 2007-03-19 Rolf Bjarne Kvinge * Control.cs: Fix 2.0 signature for Invoke. Support invoking on diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs index 3d0dad330fa..58a1dc4ea62 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs @@ -3288,13 +3288,13 @@ namespace System.Windows.Forms if (!is_created) { is_created = true; - } - if (binding_context == null) { // seem to be sent whenever it's null? - OnBindingContextChanged(EventArgs.Empty); - } + if (binding_context == null) { // seem to be sent whenever it's null? + OnBindingContextChanged(EventArgs.Empty); + } - OnCreateControl(); + OnCreateControl(); + } } public Graphics CreateGraphics() { @@ -4868,6 +4868,7 @@ namespace System.Windows.Forms private void WmShowWindow (ref Message m) { if (m.WParam.ToInt32() != 0) { + CreateControl (); /* if we're being shown, make sure our child controls all have their handles created */ Control [] controls = child_controls.GetAllControls (); for (int i=0; i