2003-11-26 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]): When orderWin == 0, make sure the window does not go in front of the current key window. Index: Source/x11/XGServerWindow.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/back/Source/x11/XGServerWindow.m,v retrieving revision 1.35 diff -u -r1.35 XGServerWindow.m --- Source/x11/XGServerWindow.m 19 Nov 2003 16:05:29 -0000 1.35 +++ Source/x11/XGServerWindow.m 27 Nov 2003 04:36:17 -0000 @@ -1534,10 +1534,27 @@ NSDebugLLog(@"XGTrace", @"DPSorderwindow: %d : %d : %d",op,otherWin,winNum); level = window->win_attrs.window_level; - if (otherWin != 0) + if (otherWin > 0) { other = WINDOW_WITH_TAG(otherWin); - level = other->win_attrs.window_level; + if (other) + level = other->win_attrs.window_level; + } + else if (otherWin == 0 && op == NSWindowAbove) + { + /* Don't let the window go in front of the current key/main window. */ + /* FIXME: Don't know how to get the current main window. */ + Window keywin; + int revert, status; + status = XGetInputFocus(dpy, &keywin, &revert); + other = NULL; + if (status == True) + { + /* Alloc a temporary window structure */ + other = GSAutoreleasedBuffer(sizeof(gswindow_device_t)); + other->ident = keywin; + op = NSWindowBelow; + } } else {