Prevent orderwindow:relativeTo: from making a window key.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@18367 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2004-01-10 22:41:10 +00:00
parent 8fb6577797
commit 0e9bbf7672
4 changed files with 21 additions and 1 deletions

View file

@ -1,3 +1,13 @@
2004-01-10 Adam Fedor <fedor@gnu.org>
* Prevent orderwindow:relativeTo: from making a window key.
* Headers/x11/XGGeneric.h: Add Ivar.
* Source/x11/XGServerEvent.m (-_handleTakeFocusAtom:forContext:):
Don't take focus if we ordered this window previously.
* Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]):
Set desiredOrderWindow.
([XGServer -setinputfocus:]): Reset it.
2004-01-10 Adam Fedor <fedor@gnu.org>
* Source/x11/XGServerWindow.m ([XGServer -orderwindow:::]):

View file

@ -76,6 +76,7 @@ struct XGGeneric {
long currentFocusWindow;
long desiredFocusWindow;
unsigned long focusRequestNumber;
unsigned long desiredOrderedWindow;
unsigned char lMouse;
unsigned char mMouse;
unsigned char rMouse;

View file

@ -1300,6 +1300,12 @@ static inline int check_modifier (XEvent *xEvent, KeyCode key_code)
NSDebugLLog(@"Focus", @"Key window is already %d", key_num);
[GSServerForWindow(key_win) setinputfocus: key_num];
}
else if (generic.desiredOrderedWindow == cWin->number)
{
/* We just want to order the window, not give it focus */
NSDebugLLog(@"Focus", @"Ignoring focus request");
generic.desiredOrderedWindow = 0;
}
else
{
NSPoint eventLocation;

View file

@ -1575,8 +1575,10 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
if (op != NSWindowOut && window->map_state != IsViewable)
{
XMoveWindow(dpy, window->ident, window->siz_hints.x,
window->siz_hints.y);
window->siz_hints.y);
setNormalHints(dpy, window);
/* Set this to ignore any take focus events for this window */
generic.desiredOrderedWindow = winNum;
}
switch (op)
@ -2351,6 +2353,7 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
NSDebugLLog(@"Focus", @"Setting focus to %d", window->number);
generic.desiredFocusWindow = win;
generic.focusRequestNumber = XNextRequest(dpy);
generic.desiredOrderedWindow = 0;
XSetInputFocus(dpy, window->ident, RevertToParent, generic.lastTime);
[inputServer ximFocusICWindow: window];
}