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.
This commit is contained in:
Tony Crisci 2014-05-04 07:50:23 -04:00 committed by Michael Stapelberg
parent 13db562551
commit b714878f52
1 changed files with 7 additions and 1 deletions

View File

@ -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("--> OUTCOME = %p\n", con);
DLOG("type = %d, name = %s\n", con->type, con->name); DLOG("type = %d, name = %s\n", con->type, con->name);
/* if focus changes, we must rerender */
Con *initially_focused = focused;
/* dont handle dockarea cons, they must not be focused */ /* dont handle dockarea cons, they must not be focused */
if (con->parent->type == CT_DOCKAREA) if (con->parent->type == CT_DOCKAREA)
goto done; goto done;
@ -297,7 +300,10 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod
done: done:
xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time); xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time);
xcb_flush(conn); xcb_flush(conn);
tree_render();
if (initially_focused != focused)
tree_render();
return 0; return 0;
} }