From e99dc3ab5b5931ad938ae4d9816400214a849f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 17 Mar 2012 15:34:32 +0100 Subject: [PATCH] handle ungrab crossings for FFM & mouse preference BUG: 142040 REVIEW: 104316 --- events.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/events.cpp b/events.cpp index e74c0c4fbe..30350aa26e 100644 --- a/events.cpp +++ b/events.cpp @@ -864,9 +864,10 @@ void Client::enterNotifyEvent(XCrossingEvent* e) { if (e->window != frameId()) return; // care only about entering the whole frame - if (e->mode == NotifyNormal || - (!options->focusPolicyIsReasonable() && - e->mode == NotifyUngrab)) { + +#define MOUSE_DRIVEN_FOCUS (!options->focusPolicyIsReasonable() || \ + (options->focusPolicy() == Options::FocusFollowsMouse && options->isNextFocusPrefersMouse())) + if (e->mode == NotifyNormal || (e->mode == NotifyUngrab && MOUSE_DRIVEN_FOCUS)) { if (options->isShadeHover()) { cancelShadeHoverTimer(); @@ -877,6 +878,7 @@ void Client::enterNotifyEvent(XCrossingEvent* e) shadeHoverTimer->start(options->shadeHoverInterval()); } } +#undef MOUSE_DRIVEN_FOCUS if (options->focusPolicy() == Options::ClickToFocus) return;