-    long decor = (long) GDK_DECOR_ALL;
-    long func = (long) GDK_FUNC_ALL;
-    
-    if ((win->m_windowStyle & wxCAPTION) == 0)
-       decor |= GDK_DECOR_TITLE;
-/*  if ((win->m_windowStyle & wxMINIMIZE) == 0)
-       func |= GDK_FUNC_MINIMIZE;
-    if ((win->m_windowStyle & wxMAXIMIZE) == 0)
-       func |= GDK_FUNC_MAXIMIZE;            */
-    if ((win->m_windowStyle & wxSYSTEM_MENU) == 0)
-       decor |= GDK_DECOR_MENU;
-    if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0)
-       decor |= GDK_DECOR_MINIMIZE;
-    if ((win->m_windowStyle & wxMAXIMIZE_BOX) == 0)
-       decor |= GDK_DECOR_MAXIMIZE;
-    if ((win->m_windowStyle & wxRESIZE_BORDER) == 0)
-       func |= GDK_FUNC_RESIZE;
-       
+    long decor = (long) GDK_DECOR_BORDER;
+    long func = (long) GDK_FUNC_MOVE ;
+
+    /* Some WM don't display any border around the frame contents if
+       used with these hints, so we add a resize border around it,
+       without automatically allowinng it to be resized though.
+
+       This avoids the problem, but looks odd. What shall we do?
+    */
+    decor |= GDK_DECOR_RESIZEH;
+
+    if ((win->GetWindowStyle() & wxCAPTION) != 0)
+        decor |= GDK_DECOR_TITLE;
+    if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0)
+    {
+       decor |= GDK_DECOR_MENU;
+       func |= GDK_FUNC_CLOSE;
+    }
+    if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0)
+    {
+        func |= GDK_FUNC_MINIMIZE;
+        decor |= GDK_DECOR_MINIMIZE;
+    }
+    if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0)
+    {
+        decor |= GDK_DECOR_MAXIMIZE;
+        func |= GDK_FUNC_MAXIMIZE;
+    }
+    if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0)
+    {
+       func |= GDK_FUNC_RESIZE;
+       decor |= GDK_DECOR_RESIZEH;
+    }