]> git.sur5r.net Git - i3/i3/commitdiff
Avoid rendering the tree twice in a row 2112/head
authorIngo Bürk <ingo.buerk@tngtech.com>
Tue, 15 Dec 2015 12:21:11 +0000 (07:21 -0500)
committerIngo Bürk <ingo.buerk@tngtech.com>
Tue, 15 Dec 2015 18:59:50 +0000 (13:59 -0500)
The callee already renders the tree if necessary, so despite the documentation
of the function, doing it again on the caller side is unnecessary.

src/bindings.c
src/click.c
src/key_press.c

index 16235a1e2bbe4a81449347a21044f198572a9999..3463f8315304957f9d823a9bba6a6b4e94d3b36b 100644 (file)
@@ -643,8 +643,8 @@ void binding_free(Binding *bind) {
 /*
  * Runs the given binding and handles parse errors. If con is passed, it will
  * execute the command binding with that container selected by criteria.
- * Returns a CommandResult for running the binding's command. Caller should
- * render tree if needs_tree_render is true. Free with command_result_free().
+ * Returns a CommandResult for running the binding's command. Free with
+ * command_result_free().
  *
  */
 CommandResult *run_binding(Binding *bind, Con *con) {
index 66a271c287f581c955f359d348ac95c277982fd7..a670120f110f73ed3a0724c4c60fa31ffae642b7 100644 (file)
@@ -198,11 +198,7 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod
             xcb_allow_events(conn, XCB_ALLOW_ASYNC_POINTER, event->time);
             xcb_flush(conn);
 
-            if (result->needs_tree_render)
-                tree_render();
-
             command_result_free(result);
-
             return 0;
         }
     }
@@ -370,10 +366,6 @@ int handle_button_press(xcb_button_press_event_t *event) {
             Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event);
             if (bind != NULL && bind->whole_window) {
                 CommandResult *result = run_binding(bind, NULL);
-                if (result->needs_tree_render) {
-                    tree_render();
-                }
-
                 command_result_free(result);
             }
         }
index aa6d815066beaf423142edb1a456664fbde12e3f..6760e35bc5219b4389bccbf3b0713f1cacc0749c 100644 (file)
@@ -31,9 +31,5 @@ void handle_key_press(xcb_key_press_event_t *event) {
         return;
 
     CommandResult *result = run_binding(bind, NULL);
-
-    if (result->needs_tree_render)
-        tree_render();
-
     command_result_free(result);
 }