From ad812e6299223efb0cb4faee03ce99870e5c7ce5 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 17 Dec 2009 16:20:03 -0500 Subject: Add a focus option, unfocusOnLeave that removes focus from a window when the pointer leaves it This uses the same delay to unfocus as is used for focusing on enter --- openbox/actions.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'openbox/actions.c') diff --git a/openbox/actions.c b/openbox/actions.c index 78546361..5d47b33f 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -408,13 +408,19 @@ void actions_client_move(ObActionsData *data, gboolean start) are ignored during a grab, so don't force fake ones when they should be ignored */ - if ((c = client_under_pointer()) && c != data->client && - !grab_on_pointer()) - { - ob_debug_type(OB_DEBUG_FOCUS, - "Generating fake enter because we did a " - "mouse-event action"); - event_enter_client(c); + if (!grab_on_pointer()) { + if ((c = client_under_pointer()) && c != data->client) { + ob_debug_type(OB_DEBUG_FOCUS, + "Generating fake enter because we did a " + "mouse-event action"); + event_enter_client(c); + } + else if (!c && c != data->client) { + ob_debug_type(OB_DEBUG_FOCUS, + "Generating fake leave because we did a " + "mouse-event action"); + event_enter_client(data->client); + } } } else if (!data->button && !config_focus_under_mouse) -- cgit v1.2.3