diff options
author | Danny Baumann <dannybaumann@web.de> | 2008-08-08 14:06:20 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2008-08-08 14:06:20 +0200 |
commit | f652a3a041c84c8ef0ded4f5792b58cc9919fff8 (patch) | |
tree | b7affff21f8acad0cf7ce0be4359b2298ad75ad5 /src | |
parent | 1c53bbcdea62433ec7081810228ada24143a58d0 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/event.c | 81 |
1 files changed, 38 insertions, 43 deletions
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); } } } |