From f652a3a041c84c8ef0ded4f5792b58cc9919fff8 Mon Sep 17 00:00:00 2001 From: Danny Baumann Date: Fri, 8 Aug 2008 14:06:20 +0200 Subject: Also update d->below variable when we have a grab, so that it has the correct value after grab end. Needed e.g. for focussing the correct default window after viewport changes with click_to_focus disabled. --- src/event.c | 81 +++++++++++++++++++++++++++++-------------------------------- 1 file changed, 38 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/event.c b/src/event.c index 86f53385..f823eea3 100644 --- a/src/event.c +++ b/src/event.c @@ -2133,59 +2133,54 @@ handleEvent (CompDisplay *d, } break; case EnterNotify: - if (!d->screens->maxGrab && - event->xcrossing.mode != NotifyGrab && - event->xcrossing.mode != NotifyUngrab && - event->xcrossing.detail != NotifyInferior) - { - Bool raise; - int delay; + s = findScreenAtDisplay (d, event->xcrossing.root); + if (s) + w = findTopLevelWindowAtScreen (s, event->xcrossing.window); + else + w = NULL; - raise = d->opt[COMP_DISPLAY_OPTION_AUTORAISE].value.b; - delay = d->opt[COMP_DISPLAY_OPTION_AUTORAISE_DELAY].value.i; + if (w && w->id != d->below) + { + d->below = w->id; - s = findScreenAtDisplay (d, event->xcrossing.root); - if (s) + if (!d->opt[COMP_DISPLAY_OPTION_CLICK_TO_FOCUS].value.b && + !d->screens->maxGrab && + event->xcrossing.mode != NotifyGrab && + event->xcrossing.mode != NotifyUngrab && + event->xcrossing.detail != NotifyInferior) { - w = findTopLevelWindowAtScreen (s, event->xcrossing.window); - } - else - w = NULL; + Bool raise; + int delay; - if (w && w->id != d->below) - { - d->below = w->id; + raise = d->opt[COMP_DISPLAY_OPTION_AUTORAISE].value.b; + delay = d->opt[COMP_DISPLAY_OPTION_AUTORAISE_DELAY].value.i; - if (!d->opt[COMP_DISPLAY_OPTION_CLICK_TO_FOCUS].value.b) + if (d->autoRaiseHandle && d->autoRaiseWindow != w->id) { - if (d->autoRaiseHandle && - d->autoRaiseWindow != w->id) - { - compRemoveTimeout (d->autoRaiseHandle); - d->autoRaiseHandle = 0; - } + compRemoveTimeout (d->autoRaiseHandle); + d->autoRaiseHandle = 0; + } - if (w->type & ~(CompWindowTypeDockMask | - CompWindowTypeDesktopMask)) - { - moveInputFocusToWindow (w); + if (w->type & ~(CompWindowTypeDockMask | + CompWindowTypeDesktopMask)) + { + moveInputFocusToWindow (w); - if (raise) + if (raise) + { + if (delay > 0) { - if (delay > 0) - { - d->autoRaiseWindow = w->id; - d->autoRaiseHandle = - compAddTimeout (delay, (float) delay * 1.2, - autoRaiseTimeout, d); - } - else - { - CompStackingUpdateMode mode = - CompStackingUpdateModeNormal; + d->autoRaiseWindow = w->id; + d->autoRaiseHandle = + compAddTimeout (delay, (float) delay * 1.2, + autoRaiseTimeout, d); + } + else + { + CompStackingUpdateMode mode = + CompStackingUpdateModeNormal; - updateWindowAttributes (w, mode); - } + updateWindowAttributes (w, mode); } } } -- cgit v1.2.3