2006-08-08 Peter Dennis Bartok <pbartok@novell.com>
authorPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>
Tue, 8 Aug 2006 16:40:04 +0000 (16:40 -0000)
committerPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>
Tue, 8 Aug 2006 16:40:04 +0000 (16:40 -0000)
* ComboBox.cs: Added focus reflection for popup window
* XplatUIX11.cs:
  - Removed transient setting for non-app windows for now, not sure it
    was needed
  - Fixed logic checking if we have captions when deciding
    override_redirect, WS_CAPTION is two bits and a 0 check was not
    sufficient
  - Removed the WINDOW_TYPE stuff, it was unneeded and making things
    complicated
* Form.cs:
  - AddOwnedForm: Don't just add the form to the list, call the property
    to ensure the driver is informed about the ownership as well
  - CreateHandle: Set the TopMost status in the driver if we have an owner
* XplatUI.cs: Fixed debug statement

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs

index 345d819cb3aab9df89ed3c2169fbcbdec5557e1b..e94e1ee622b2c13668a45b6ba1742c1a6441053c 100644 (file)
@@ -1,6 +1,24 @@
-2006-08-08  Jonathan Pobst <monkey@jpobst.com>
+2006-08-08  Peter Dennis Bartok  <pbartok@novell.com>
+
+       * ComboBox.cs: Added focus reflection for popup window
+       * XplatUIX11.cs: 
+         - Removed transient setting for non-app windows for now, not sure it
+           was needed
+         - Fixed logic checking if we have captions when deciding 
+           override_redirect, WS_CAPTION is two bits and a 0 check was not
+           sufficient
+         - Removed the WINDOW_TYPE stuff, it was unneeded and making things
+           complicated
+       * Form.cs: 
+         - AddOwnedForm: Don't just add the form to the list, call the property
+           to ensure the driver is informed about the ownership as well
+         - CreateHandle: Set the TopMost status in the driver if we have an owner
+       * XplatUI.cs: Fixed debug statement
+
+2006-08-08  Jonathan Pobst <monkey@jpobst.com>
        * ButtonRenderer.cs, CheckBoxRenderer.cs, ComboBoxRenderer.cs
-         GroupBoxRenderer.cs, ProgressBarRenderer.cs, RadioButtonRenderer.cs,            ScrollBarRenderer.cs, TabRenderer.cs, TextBoxRenderer.cs, 
+         GroupBoxRenderer.cs, ProgressBarRenderer.cs, RadioButtonRenderer.cs,
+         ScrollBarRenderer.cs, TabRenderer.cs, TextBoxRenderer.cs, 
          TrackBarRenderer.cs: Make constructor private.
        * ProfessionalColors.cs, ProfessionalColorTable.cs: Fix misnamed properties.
        * ProfessionalColorTable.cs: Make properties virtual.
@@ -10,7 +28,7 @@
        * NumericUpDown.cs (Value): Don't call OnValueChanged if the value
        is not changing.
 
-2006-08-04  Jonathan Pobst <monkey@jpobst.com>
+2006-08-04  Jonathan Pobst <monkey@jpobst.com>
        * ButtonRenderer.cs, CheckBoxRenderer.cs, ComboBoxRenderer.cs
          GroupBoxRenderer.cs, ProfessionalColors.cs, ProfessionalColorTable.cs,
          ProgressBarRenderer.cs, RadioButtonRenderer.cs, ScrollBarRenderer.cs,
index 72f20fe208da65f0b179948c78b11ab164ec46a1..08711a020be709708c3be4b055620caff9ba1cbf 100644 (file)
@@ -1775,7 +1775,7 @@ namespace System.Windows.Forms
                        {
                                if (owner.DropDownStyle == ComboBoxStyle.Simple && owner.Items.Count == 0)
                                        return false;
-                                       
+
                                HighlightedIndex = owner.SelectedIndex;
 
                                CalcListBoxArea ();                             
@@ -1826,6 +1826,15 @@ namespace System.Windows.Forms
                                Refresh ();
                        }                       
                        
+                       protected override void WndProc(ref Message m) {
+                               if (m.Msg == (int)Msg.WM_SETFOCUS) {
+                                       if (m.WParam != IntPtr.Zero) {
+                                               XplatUI.SetFocus(m.WParam);
+                                       }
+                               }
+                               base.WndProc (ref m);
+                       }
+
                        #endregion Private Methods
                }
        }
index 5f4e0092e4003cb88efa05ace2f0d235b9df03f1..d9e79baad005a46f2e58de6f4b3072461cfd7ee8 100644 (file)
@@ -1132,7 +1132,7 @@ namespace System.Windows.Forms {
                }
 
                public void AddOwnedForm(Form ownedForm) {
-                       owned_forms.Add(ownedForm);
+                       ownedForm.Owner = this;
                }
 
                public void Close () {
@@ -1360,6 +1360,19 @@ namespace System.Windows.Forms {
                        if (icon != null) {
                                XplatUI.SetIcon(window.Handle, icon);
                        }
+
+                       if ((owner != null) && (owner.IsHandleCreated)) {
+                               XplatUI.SetTopmost(window.Handle, owner.window.Handle, true);
+                       }
+
+                       if (owned_forms.Count > 0) {
+                               for (int i = 0; i < owned_forms.Count; i++) {
+                                       if (owned_forms[i].IsHandleCreated) {
+                                               XplatUI.SetTopmost(owned_forms[i].window.Handle, window.Handle, true);
+                                       }
+                               }
+                       }
+
                }
 
                [EditorBrowsable(EditorBrowsableState.Advanced)]
index 960eeee31a00f60e732e4db2df0e92059d13b36c..86bc4f23144208a135ae7cfafd4683cd3d3c0f94 100644 (file)
@@ -880,7 +880,7 @@ namespace System.Windows.Forms {
 
                internal static bool SupportsTransparency() {
                        #if DriverDebug
-                               Console.WriteLine("SupportsTransparency(): Called, result={1}", driver.SupportsTransparency());
+                               Console.WriteLine("SupportsTransparency(): Called, result={0}", driver.SupportsTransparency());
                        #endif
                        return driver.SupportsTransparency();
                }
index 6c1a0c4a5c99711fc1aec43b2ae64b6894fe2a59..42ac0df06bb3217d7fec1467cad28faef6f2a9b7 100644 (file)
@@ -758,13 +758,12 @@ namespace System.Windows.Forms {
                        client_rect = hwnd.ClientRect;
                        lock (XlibLock) {
                                XChangeProperty(DisplayHandle, hwnd.whole_window, NetAtoms[(int)NA._MOTIF_WM_HINTS], NetAtoms[(int)NA._MOTIF_WM_HINTS], 32, PropertyMode.Replace, ref mwmHints, 5);
-
-                               if (((cp.Style & (int)WindowStyles.WS_POPUP) != 0)  && (hwnd.parent != null) && (hwnd.parent.whole_window != IntPtr.Zero)) {
+                               if (((cp.Style & (int)WindowStyles.WS_POPUP) != 0) && (hwnd.parent != null) && (hwnd.parent.whole_window != IntPtr.Zero)) {
                                        transient = true;
                                        XSetTransientForHint(DisplayHandle, hwnd.whole_window, hwnd.parent.whole_window);
                                } else if ((cp.ExStyle & (int)WindowExStyles.WS_EX_APPWINDOW) == 0) {
-                                       transient = true;
-                                       XSetTransientForHint(DisplayHandle, hwnd.whole_window, FosterParent);
+//                                     transient = true;
+//                                     XSetTransientForHint(DisplayHandle, hwnd.whole_window, FosterParent);
                                }
                                if ((client_rect.Width < 1) || (client_rect.Height < 1)) {
                                        XMoveResizeWindow(DisplayHandle, hwnd.client_window, -5, -5, 1, 1);
@@ -780,24 +779,8 @@ namespace System.Windows.Forms {
                                }
                                XChangeProperty(DisplayHandle, hwnd.whole_window, NetAtoms[(int)NA._NET_WM_STATE], (IntPtr)Atom.XA_ATOM, 32, PropertyMode.Replace, atoms, atom_count);
 
-                               if ((cp.ExStyle & (int)WindowExStyles.WS_EX_TOPMOST) != 0) {
-                                       atom_count = 0;
-                                       atoms[atom_count++] = NetAtoms[(int)NA._NET_WM_WINDOW_TYPE_DOCK].ToInt32();
-                                       XChangeProperty(DisplayHandle, hwnd.whole_window, NetAtoms[(int)NA._NET_WM_WINDOW_TYPE], (IntPtr)Atom.XA_ATOM, 32, PropertyMode.Replace, atoms, atom_count);
-                               } else if (transient) {
-                                       atom_count = 0;
-
-                                       if ((cp.ExStyle & ((int)WindowExStyles.WS_EX_TOOLWINDOW)) != 0) {
-                                               atoms[atom_count++] = NetAtoms[(int)NA._NET_WM_WINDOW_TYPE_DOCK].ToInt32();
-                                       } else {
-                                               atoms[atom_count++] = NetAtoms[(int)NA._NET_WM_WINDOW_TYPE_DIALOG].ToInt32();
-                                       }
-                                       XChangeProperty(DisplayHandle, hwnd.whole_window, NetAtoms[(int)NA._NET_WM_WINDOW_TYPE], (IntPtr)Atom.XA_ATOM, 32, PropertyMode.Replace, atoms, atom_count);
-                               }
-
                                atom_count = 0;
                                IntPtr[] atom_ptrs = new IntPtr[2];
-
                                atom_ptrs[atom_count++] = NetAtoms[(int)NA.WM_DELETE_WINDOW];
                                if ((cp.ExStyle & (int)WindowExStyles.WS_EX_CONTEXTHELP) != 0) {
                                        atom_ptrs[atom_count++] = NetAtoms[(int)NA._NET_WM_CONTEXT_HELP];
@@ -2172,7 +2155,7 @@ namespace System.Windows.Forms {
 
                        // If we're a popup without caption we override the WM
                        if ((cp.Style & ((int)WindowStyles.WS_POPUP)) != 0) {
-                               if ((cp.Style & (int)WindowStyles.WS_CAPTION) == 0) {
+                               if ((cp.Style & (int)WindowStyles.WS_CAPTION) != (int)WindowStyles.WS_CAPTION) {
                                        Attributes.override_redirect = true;
                                        ValueMask |= SetWindowValuemask.OverrideRedirect;
                                }
@@ -2241,7 +2224,7 @@ namespace System.Windows.Forms {
                        if ((cp.ExStyle & (int)WindowExStyles.WS_EX_TOPMOST) != 0) {
                                XSetTransientForHint (DisplayHandle, hwnd.whole_window, RootWindow);
                        } else if ((cp.ExStyle & (int)WindowExStyles.WS_EX_APPWINDOW) == 0) {
-                               XSetTransientForHint (DisplayHandle, hwnd.whole_window, FosterParent);
+//                             XSetTransientForHint (DisplayHandle, hwnd.whole_window, FosterParent);
                        }
 
                        SetWMStyles(hwnd, cp);