aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
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/input/keyboard.c
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/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index ce259eb2..95e53934 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -9,7 +9,6 @@
9#include <wlr/types/wlr_keyboard_group.h> 9#include <wlr/types/wlr_keyboard_group.h>
10#include <xkbcommon/xkbcommon-names.h> 10#include <xkbcommon/xkbcommon-names.h>
11#include "sway/commands.h" 11#include "sway/commands.h"
12#include "sway/desktop/transaction.h"
13#include "sway/input/input-manager.h" 12#include "sway/input/input-manager.h"
14#include "sway/input/keyboard.h" 13#include "sway/input/keyboard.h"
15#include "sway/input/seat.h" 14#include "sway/input/seat.h"
@@ -500,7 +499,6 @@ static void handle_key_event(struct sway_keyboard *keyboard,
500 } 499 }
501 } 500 }
502 501
503 transaction_commit_dirty();
504 502
505 free(device_identifier); 503 free(device_identifier);
506} 504}
@@ -587,7 +585,6 @@ static int handle_keyboard_repeat(void *data) {
587 585
588 seat_execute_command(keyboard->seat_device->sway_seat, 586 seat_execute_command(keyboard->seat_device->sway_seat,
589 keyboard->repeat_binding); 587 keyboard->repeat_binding);
590 transaction_commit_dirty();
591 } 588 }
592 return 0; 589 return 0;
593} 590}