- 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_leave_client(data->client);
+ }