aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2021-02-08 02:03:01 +0100
committerLibravatar Tudor Brindus <me@tbrindus.ca>2021-02-14 13:19:08 -0500
commitb5b628cb41a4a316456d5ef3014f1a2cbdc5cfc2 (patch)
treef2dca5621c62d4fea0546c8b9eee99a3cc6dfd6c /sway/commands
parentreadme: update French translation (diff)
downloadsway-b5b628cb41a4a316456d5ef3014f1a2cbdc5cfc2.tar.gz
sway-b5b628cb41a4a316456d5ef3014f1a2cbdc5cfc2.tar.zst
sway-b5b628cb41a4a316456d5ef3014f1a2cbdc5cfc2.zip
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.
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/bind.c3
1 files changed, 3 insertions, 0 deletions
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 @@
8#include <wlr/types/wlr_cursor.h> 8#include <wlr/types/wlr_cursor.h>
9#include "sway/commands.h" 9#include "sway/commands.h"
10#include "sway/config.h" 10#include "sway/config.h"
11#include "sway/desktop/transaction.h"
11#include "sway/input/cursor.h" 12#include "sway/input/cursor.h"
12#include "sway/input/keyboard.h" 13#include "sway/input/keyboard.h"
13#include "sway/ipc-server.h" 14#include "sway/ipc-server.h"
@@ -642,6 +643,8 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding)
642 if (success) { 643 if (success) {
643 ipc_event_binding(binding); 644 ipc_event_binding(binding);
644 } 645 }
646
647 transaction_commit_dirty();
645} 648}
646 649
647/** 650/**