mirror of
https://github.com/gnustep/libs-back.git
synced 2025-06-01 17:52:33 +00:00
Made handling of focus in and out more explicit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@25403 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
86a9213e9f
commit
5e75161bf3
2 changed files with 135 additions and 124 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2007-08-21 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/x11/XGServerEvent.m (-processEvent:): Made handling of
|
||||||
|
focus in and out more explicit.
|
||||||
|
|
||||||
2007-08-16 Fred Kiefer <FredKiefer@gmx.de>
|
2007-08-16 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/xlib/XGFontManager.m (load_cache),
|
* Source/xlib/XGFontManager.m (load_cache),
|
||||||
|
|
|
@ -995,6 +995,7 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym,
|
||||||
break;
|
break;
|
||||||
NSDebugLLog(@"Focus", @"%d got focus on %d\n",
|
NSDebugLLog(@"Focus", @"%d got focus on %d\n",
|
||||||
xEvent.xfocus.window, cWin->number);
|
xEvent.xfocus.window, cWin->number);
|
||||||
|
// Store this for debugging, may not be the real focus window
|
||||||
generic.currentFocusWindow = cWin->number;
|
generic.currentFocusWindow = cWin->number;
|
||||||
if (xEvent.xfocus.serial == generic.focusRequestNumber)
|
if (xEvent.xfocus.serial == generic.focusRequestNumber)
|
||||||
{
|
{
|
||||||
|
@ -1023,6 +1024,8 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym,
|
||||||
XGetInputFocus(xEvent.xfocus.display, &fw, &rev);
|
XGetInputFocus(xEvent.xfocus.display, &fw, &rev);
|
||||||
NSDebugLLog(@"NSEvent", @"%d FocusOut\n",
|
NSDebugLLog(@"NSEvent", @"%d FocusOut\n",
|
||||||
xEvent.xfocus.window);
|
xEvent.xfocus.window);
|
||||||
|
if (fw != None && fw != PointerRoot)
|
||||||
|
{
|
||||||
generic.cachedWindow = [XGServer _windowForXWindow: fw];
|
generic.cachedWindow = [XGServer _windowForXWindow: fw];
|
||||||
if (cWin == 0)
|
if (cWin == 0)
|
||||||
{
|
{
|
||||||
|
@ -1036,19 +1039,21 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym,
|
||||||
{
|
{
|
||||||
nswin = GSWindowWithNumber(cWin->number);
|
nswin = GSWindowWithNumber(cWin->number);
|
||||||
}
|
}
|
||||||
NSDebugLLog(@"Focus", @"Focus went to %d (xwin %d)\n",
|
|
||||||
(cWin) ? cWin->number : 0, fw);
|
|
||||||
if (nswin == nil)
|
|
||||||
{
|
|
||||||
if (fw == 0)
|
|
||||||
{
|
|
||||||
/* What? This is bogus. Focus has to go somewhere. */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
nswin = nil;
|
||||||
|
}
|
||||||
|
NSDebugLLog(@"Focus", @"Focus went to %d (xwin %d)\n",
|
||||||
|
(nswin != nil) ? cWin->number : 0, fw);
|
||||||
|
|
||||||
|
// Focus went to a window not in this application.
|
||||||
|
if (nswin == nil)
|
||||||
{
|
{
|
||||||
[NSApp deactivate];
|
[NSApp deactivate];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Clean up old focus request
|
||||||
generic.cachedWindow
|
generic.cachedWindow
|
||||||
= [XGServer _windowForXWindow: xEvent.xfocus.window];
|
= [XGServer _windowForXWindow: xEvent.xfocus.window];
|
||||||
NSDebugLLog(@"Focus", @"%d lost focus on %d\n",
|
NSDebugLLog(@"Focus", @"%d lost focus on %d\n",
|
||||||
|
@ -1564,7 +1569,8 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym,
|
||||||
cWin->number, generic.currentFocusWindow, key_num);
|
cWin->number, generic.currentFocusWindow, key_num);
|
||||||
|
|
||||||
/* Sometimes window managers lose the setinputfocus on the key window
|
/* Sometimes window managers lose the setinputfocus on the key window
|
||||||
* e.g. when ordering out a window with focus then ordering in the key window. * it might search for a window until one accepts its take focus request.
|
* e.g. when ordering out a window with focus then ordering in the key window.
|
||||||
|
* it might search for a window until one accepts its take focus request.
|
||||||
*/
|
*/
|
||||||
if (key_num == cWin->number)
|
if (key_num == cWin->number)
|
||||||
cWin->ignore_take_focus = NO;
|
cWin->ignore_take_focus = NO;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue