From b5b628cb41a4a316456d5ef3014f1a2cbdc5cfc2 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Mon, 8 Feb 2021 02:03:01 +0100 Subject: input: Only commit transactions when necessary There is no need to check for transactions at the end of every user input, as the vast majority of input will not issue transactions. This implementation can also hide where changes are made without an appropriate transaction commit, as a future unrelated input would issue the commit instead. Instead, commit transactions in places where changes are made or are likely to be made. --- sway/commands/bind.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sway/commands') diff --git a/sway/commands/bind.c b/sway/commands/bind.c index f6e58d99..4c67b3ce 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c @@ -8,6 +8,7 @@ #include #include "sway/commands.h" #include "sway/config.h" +#include "sway/desktop/transaction.h" #include "sway/input/cursor.h" #include "sway/input/keyboard.h" #include "sway/ipc-server.h" @@ -642,6 +643,8 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) if (success) { ipc_event_binding(binding); } + + transaction_commit_dirty(); } /** -- cgit v1.2.3