Fixed inconsistency in conditions that determines if a window requires
a WM border.

diff --git a/windows/nonclient.c b/windows/nonclient.c
index 0ba158f..8e37d09 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -75,6 +75,21 @@
  (((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT))
 
 /***********************************************************************
+ *           WIN_WindowNeedsWMBorder
+ *
+ * This method defines the rules for a window to have a WM border,
+ * caption...  It is used for consitency purposes.
+ */
+BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle )
+{
+    if (!(style & WS_CHILD) && Options.managed  &&
+        (((style & WS_CAPTION) == WS_CAPTION) ||
+         (style & WS_THICKFRAME) ||
+         (exStyle & WS_EX_DLGMODALFRAME))) return TRUE;
+    return FALSE;
+}
+
+/***********************************************************************
  *           NC_AdjustRect
  *
  * Compute the size of the window rectangle from the size of the
@@ -88,9 +103,7 @@
 
     if(style & WS_ICONIC) return;
     /* Decide if the window will be managed (see CreateWindowEx) */
-    if (!(Options.managed && !(style & WS_CHILD) &&
-          ((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
-           (exStyle & WS_EX_DLGMODALFRAME))))
+    if (!WIN_WindowNeedsWMBorder(style, exStyle))
     {
         if (HAS_THICKFRAME( style, exStyle ))
             InflateRect16( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );
@@ -156,9 +169,7 @@
     if(style & WS_ICONIC) return;
 
     /* Decide if the window will be managed (see CreateWindowEx) */
-    if (!(Options.managed && !(style & WS_CHILD) &&
-          ((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
-           (exStyle & WS_EX_DLGMODALFRAME))))
+    if (!WIN_WindowNeedsWMBorder(style, exStyle))
     {
         if (HAS_THICKFRAME( style, exStyle ))
             InflateRect16( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );
diff --git a/windows/x11drv/wnd.c b/windows/x11drv/wnd.c
index 96ed420..8a43fdf 100644
--- a/windows/x11drv/wnd.c
+++ b/windows/x11drv/wnd.c
@@ -188,9 +188,7 @@
       
       /* Create "managed" windows only if a title bar or resizable */
       /* frame is required. */
-      if (Options.managed && ( ((cs->style & WS_CAPTION) == WS_CAPTION) ||
-                              (cs->style & WS_THICKFRAME) ||
-			      (cs->dwExStyle & WS_EX_DLGMODALFRAME)))
+        if (WIN_WindowNeedsWMBorder(cs->style, cs->dwExStyle))
         {
 	  win_attr.event_mask = ExposureMask | KeyPressMask |
 	    KeyReleaseMask | PointerMotionMask |