Attempt to fix incorrect focusing when using focus list.

In pointer focus modes, when the pointer is over the focus list,
the window below would always get focus.

SVN revision: 47261
This commit is contained in:
Kim Woelders 2010-03-15 22:19:03 +00:00
parent ae1e289a62
commit 9cea078c73
2 changed files with 16 additions and 3 deletions

View File

@ -44,6 +44,7 @@ static EWin *focus_pending_ewin = NULL;
static EWin *focus_pending_new = NULL;
static EWin *focus_pending_raise = NULL;
static Timer *focus_timer_autoraise = NULL;
static int focus_request = 0;
void
FocusEnable(int on)
@ -442,6 +443,7 @@ doFocusToEwin(EWin * ewin, int why)
if (why == FOCUS_DESK_LEAVE)
return;
focus_request = (int)NextRequest(disp);
ICCCM_Focus(ewin);
focus_is_set = 1;
}
@ -572,6 +574,15 @@ FocusHandleEnter(EWin * ewin, XEvent * ev)
ev->xcrossing.detail == NotifyNonlinearVirtual)
return;
if ((int)ev->xcrossing.serial - focus_request < 0)
{
/* This event was caused by a request older than the latest
* focus assignment request - ignore */
if (EDebug(EDBUG_TYPE_FOCUS))
Eprintf("FocusHandleEnter: Ignore serial < %#x\n", focus_request);
return;
}
switch (Conf.focus.mode)
{
default:

View File

@ -378,10 +378,12 @@ ICCCM_Focus(const EWin * ewin)
if (EDebug(EDBUG_TYPE_FOCUS))
{
if (ewin)
Eprintf("ICCCM_Focus T=%#lx %#lx %s\n", Mode.events.time,
EwinGetClientXwin(ewin), EwinGetTitle(ewin));
Eprintf("ICCCM_Focus T=%#lx R=%#lx %#lx %s\n", Mode.events.time,
NextRequest(disp), EwinGetClientXwin(ewin),
EwinGetTitle(ewin));
else
Eprintf("ICCCM_Focus None T=%#lx\n", Mode.events.time);
Eprintf("ICCCM_Focus T=%#lx R=%#lx None\n", Mode.events.time,
NextRequest(disp));
}
if (!ewin)