From: Tony Crisci Date: Sun, 4 May 2014 11:50:23 +0000 (-0400) Subject: Rerender on button press only when focus changes X-Git-Tag: 4.8~46 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b714878f52ef7c175699ed831c5925a577621f5a;p=i3%2Fi3 Rerender on button press only when focus changes On button press events, the only change in state that would presently require rerendering the tree is when the focused window changes. --- diff --git a/src/click.c b/src/click.c index 91964b93..9b85b711 100644 --- a/src/click.c +++ b/src/click.c @@ -171,6 +171,9 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod DLOG("--> OUTCOME = %p\n", con); DLOG("type = %d, name = %s\n", con->type, con->name); + /* if focus changes, we must rerender */ + Con *initially_focused = focused; + /* don’t handle dockarea cons, they must not be focused */ if (con->parent->type == CT_DOCKAREA) goto done; @@ -297,7 +300,10 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod done: xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time); xcb_flush(conn); - tree_render(); + + if (initially_focused != focused) + tree_render(); + return 0; }