aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-15 15:20:21 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-15 22:08:26 +1000
commita120d4c79f9406a2f7cc38c60069d3183c98ea87 (patch)
tree87a568ff97fc94ca82b9ceb4abacb02ea86a9f71 /sway/input/keyboard.c
parentMerge pull request #2272 from RyanDwyer/simplify-transactions (diff)
downloadsway-a120d4c79f9406a2f7cc38c60069d3183c98ea87.tar.gz
sway-a120d4c79f9406a2f7cc38c60069d3183c98ea87.tar.zst
sway-a120d4c79f9406a2f7cc38c60069d3183c98ea87.zip
Make focus part of transactions
Rather than maintain copies of the entire focus stack, this PR transactionises the focus by introducing two new properties to the container state and using those when rendering. * `bool focused` means this container has actual focus. Only one container should have this equalling true in its current state. * `struct sway_container *focus_inactive_child` points to the immediate child that was most recently focused (eg. for tabbed and stacked containers).
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 580c0d4b..ede38519 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -3,6 +3,7 @@
3#include <wlr/backend/multi.h> 3#include <wlr/backend/multi.h>
4#include <wlr/backend/session.h> 4#include <wlr/backend/session.h>
5#include <wlr/types/wlr_idle.h> 5#include <wlr/types/wlr_idle.h>
6#include "sway/desktop/transaction.h"
6#include "sway/input/seat.h" 7#include "sway/input/seat.h"
7#include "sway/input/keyboard.h" 8#include "sway/input/keyboard.h"
8#include "sway/input/input-manager.h" 9#include "sway/input/input-manager.h"
@@ -126,6 +127,7 @@ static void keyboard_execute_command(struct sway_keyboard *keyboard,
126 binding->command); 127 binding->command);
127 config->handler_context.seat = keyboard->seat_device->sway_seat; 128 config->handler_context.seat = keyboard->seat_device->sway_seat;
128 struct cmd_results *results = execute_command(binding->command, NULL); 129 struct cmd_results *results = execute_command(binding->command, NULL);
130 transaction_commit_dirty();
129 if (results->status != CMD_SUCCESS) { 131 if (results->status != CMD_SUCCESS) {
130 wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)", 132 wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)",
131 binding->command, results->error); 133 binding->command, results->error);