Index: Source/x11/XGServerWindow.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/back/Source/x11/XGServerWindow.m,v retrieving revision 1.39 diff -u -r1.39 XGServerWindow.m --- Source/x11/XGServerWindow.m 10 Jan 2004 22:41:10 -0000 1.39 +++ Source/x11/XGServerWindow.m 18 Jan 2004 02:22:50 -0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,10 @@ #else #include "x11/wraster.h" #endif + +#include +#include + #include #include @@ -57,6 +62,10 @@ #define ROOT generic.appRootWindow + +static BOOL handlesWindowDecorations = NO; + + /* * Name for application root window. */ @@ -232,7 +241,8 @@ hints->functions = 0; /* Now add to the hints from the styleMask */ - if (styleMask == NSBorderlessWindowMask) + if (styleMask == NSBorderlessWindowMask + || !handlesWindowDecorations) { hints->flags |= MWM_HINTS_DECORATIONS; hints->flags |= MWM_HINTS_FUNCTIONS; @@ -321,6 +331,12 @@ @implementation XGServer (WindowOps) +-(BOOL) handlesWindowDecorations +{ + return handlesWindowDecorations; +} + + /* * Where a window has been reparented by the wm, we use this method to * locate the window given knowledge of its border window. @@ -935,8 +951,6 @@ root = [self _rootWindowForScreen: screen]; context = [self xrContextForScreen: screen]; - frame = [NSWindow contentRectForFrameRect: frame styleMask: style]; - /* We're not allowed to create a zero rect window */ if (NSWidth(frame) <= 0 || NSHeight(frame) <= 0) { @@ -1125,6 +1139,12 @@ - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b : (unsigned int) style { + if (!handlesWindowDecorations) + { + *l = *r = *t = *b = 0.0; + return; + } + /* First try to get the offset information that we have obtained from the WM. This will only work if the application has already created a window that has been reparented by the WM. Otherwise we have to @@ -1212,6 +1232,8 @@ { gswindow_device_t *window; + NSAssert(handlesWindowDecorations, @"foo"); + window = WINDOW_WITH_TAG(win); if (!window) return; @@ -1296,6 +1318,8 @@ XTextProperty windowName; gswindow_device_t *window; + NSAssert(handlesWindowDecorations, @"handlesWindowDecorations"); + window = WINDOW_WITH_TAG(win); if (!window) return; @@ -1315,6 +1339,8 @@ { gswindow_device_t *window; + NSAssert(handlesWindowDecorations, @"handlesWindowDecorations"); + window = WINDOW_WITH_TAG(win); if (!window) return; @@ -2364,6 +2390,8 @@ */ - (void) setinputstate: (int)st : (int)win { + NSAssert(handlesWindowDecorations, @"handlesWindowDecorations"); + NSDebugLLog(@"XGTrace", @"DPSsetinputstate: %d : %d", st, win); if ((generic.wm & XGWM_WINDOWMAKER) != 0) {