Bugfix: Don’t set focus if it is not necessary.

This fixes ticket #13
This commit is contained in:
Michael Stapelberg
2009-04-01 12:50:42 +02:00
parent 755540817e
commit 28aa13d831
5 changed files with 17 additions and 12 deletions

View File

@ -208,7 +208,7 @@ void remove_client_from_container(xcb_connection_t *conn, Client *client, Contai
* the user the new focus situation)
*
*/
void set_focus(xcb_connection_t *conn, Client *client) {
void set_focus(xcb_connection_t *conn, Client *client, bool set_anyways) {
/* The dock window cannot be focused, but enter notifies are still handled correctly */
if (client->dock)
return;
@ -216,7 +216,12 @@ void set_focus(xcb_connection_t *conn, Client *client) {
/* Store the old client */
Client *old_client = CUR_CELL->currently_focused;
/* TODO: check if the focus needs to be changed at all */
/* Check if the focus needs to be changed at all */
if (!set_anyways && (old_client == client)) {
LOG("old_client == client, not changing focus\n");
return;
}
/* Store current_row/current_col */
c_ws->current_row = current_row;
c_ws->current_col = current_col;