2006-05-17 Peter Dennis Bartok <pbartok@novell.com>
authorPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>
Wed, 17 May 2006 21:23:16 +0000 (21:23 -0000)
committerPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>
Wed, 17 May 2006 21:23:16 +0000 (21:23 -0000)
* XplatUIX11.cs: If client_window ends up being width or height zero
  due to border settings, move it off window inside whole_window (#78433)

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

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

index 1c54a90976d355faef9bd369497f932b52692080..4ec09aeb85eaa910d67cf69739f685091640e4b4 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-17  Peter Dennis Bartok  <pbartok@novell.com>
+
+       * XplatUIX11.cs: If client_window ends up being width or height zero
+         due to border settings, move it off window inside whole_window (#78433)
+
 2006-05-17  Alexander Olk  <alex.olk@googlemail.com>
 
        * Mime.cs: Shrink the mime file cache correctly.
index 6505d450b648fbe4b3f876e7a92492804626ba0b..a70a6faa1e3b6e7635115deb4dda59e7e4983e72 100644 (file)
@@ -756,7 +756,11 @@ namespace System.Windows.Forms {
                                        transient = true;
                                        XSetTransientForHint(DisplayHandle, hwnd.whole_window, FosterParent);
                                }
-                               XMoveResizeWindow(DisplayHandle, hwnd.client_window, client_rect.X, client_rect.Y, client_rect.Width, client_rect.Height);
+                               if ((client_rect.Width < 1) || (client_rect.Height < 1)) {
+                                       XMoveResizeWindow(DisplayHandle, hwnd.client_window, -5, -5, 1, 1);
+                               } else {
+                                       XMoveResizeWindow(DisplayHandle, hwnd.client_window, client_rect.X, client_rect.Y, client_rect.Width, client_rect.Height);
+                               }
 
                                int[] atoms = new int[8];
                                atom_count = 0;
@@ -1522,7 +1526,11 @@ namespace System.Windows.Forms {
                        rect = new Rectangle(ncp.rgrc1.left, ncp.rgrc1.top, ncp.rgrc1.right - ncp.rgrc1.left, ncp.rgrc1.bottom - ncp.rgrc1.top);
 
                        if (hwnd.visible) {
-                               XMoveResizeWindow(DisplayHandle, hwnd.client_window, rect.X, rect.Y, rect.Width, rect.Height);
+                               if ((rect.Width < 1) || (rect.Height < 1)) {
+                                       XMoveResizeWindow(DisplayHandle, hwnd.client_window, -5, -5, 1, 1);
+                               } else {
+                                       XMoveResizeWindow(DisplayHandle, hwnd.client_window, rect.X, rect.Y, rect.Width, rect.Height);
+                               }
                        }
                }
                #endregion      // Private Methods
@@ -4278,8 +4286,12 @@ namespace System.Windows.Forms {
                                }
 
                                lock (XlibLock) {
+                                       if ((client_rect.Width < 1) || (client_rect.Height < 1)) {
+                                               XMoveResizeWindow(DisplayHandle, hwnd.client_window, -5, -5, 1, 1);     // Hide the window
+                                       } else {
+                                               XMoveResizeWindow(DisplayHandle, hwnd.client_window, client_rect.X, client_rect.Y, client_rect.Width, client_rect.Height);
+                                       }
                                        XMoveResizeWindow(DisplayHandle, hwnd.whole_window, x, y, width, height);
-                                       XMoveResizeWindow(DisplayHandle, hwnd.client_window, client_rect.X, client_rect.Y, client_rect.Width, client_rect.Height);
                                }
                        }