Fix click to focus.

This commit is contained in:
Fernando Tarlá Cardoso Lemos 2010-11-29 00:11:30 -02:00 committed by Michael Stapelberg
parent b0e41cb0a2
commit 371ec037b8
2 changed files with 12 additions and 21 deletions

View File

@ -286,8 +286,7 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
return 1; return 1;
} }
if (con->layout == L_STACKED || con->layout == L_TABBED) { DLOG("border click on non-floating container at %d, %d\n", event->event_x, event->event_y);
DLOG("stacked! click is on %d, %d\n", event->event_x, event->event_y);
Con *child; Con *child;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) { TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
if (!rect_contains(child->deco_rect, event->event_x, event->event_y)) if (!rect_contains(child->deco_rect, event->event_x, event->event_y))
@ -296,22 +295,11 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
con_focus(child); con_focus(child);
break; break;
} }
tree_render(); tree_render();
return 1; return 1;
} }
#if 0
if (!floating_mod_on_tiled_client(conn, client, event)) {
#endif
xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time);
xcb_flush(conn);
#if 0
}
#endif
//return 1;
}
/* click to focus */ /* click to focus */
con_focus(con); con_focus(con);
tree_render(); tree_render();

View File

@ -263,6 +263,9 @@ int handle_motion_notify(void *ignored, xcb_connection_t *conn, xcb_motion_notif
return 1; return 1;
} }
if (config.disable_focus_follows_mouse)
return 1;
if (con->layout != L_DEFAULT) if (con->layout != L_DEFAULT)
return 1; return 1;