mirror of
https://github.com/swaywm/sway.git
synced 2026-03-17 05:34:07 -04:00
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.
This commit is contained in:
parent
b1b104152e
commit
b5b628cb41
9 changed files with 21 additions and 20 deletions
|
|
@ -9,7 +9,6 @@
|
|||
#include <wlr/types/wlr_keyboard_group.h>
|
||||
#include <xkbcommon/xkbcommon-names.h>
|
||||
#include "sway/commands.h"
|
||||
#include "sway/desktop/transaction.h"
|
||||
#include "sway/input/input-manager.h"
|
||||
#include "sway/input/keyboard.h"
|
||||
#include "sway/input/seat.h"
|
||||
|
|
@ -500,7 +499,6 @@ static void handle_key_event(struct sway_keyboard *keyboard,
|
|||
}
|
||||
}
|
||||
|
||||
transaction_commit_dirty();
|
||||
|
||||
free(device_identifier);
|
||||
}
|
||||
|
|
@ -587,7 +585,6 @@ static int handle_keyboard_repeat(void *data) {
|
|||
|
||||
seat_execute_command(keyboard->seat_device->sway_seat,
|
||||
keyboard->repeat_binding);
|
||||
transaction_commit_dirty();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue