diff --git a/ChangeLog b/ChangeLog index 6fd076f..ac05af2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-01-10 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. + 2004-01-10 16:25 Alexander Malmberg * Source/art/blit.m: Replace uses DI_16_B5G5R5A1 and DI_16_B5G6R5 diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index 76a9bee..9c6c5e7 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -1534,10 +1534,27 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number, 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 {