aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/transaction.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-15 06:49:29 -0700
committerGitHub <noreply@github.com>2018-07-15 06:49:29 -0700
commit8e05fb782658f0bc13cfba6c069ba39122417317 (patch)
tree87a568ff97fc94ca82b9ceb4abacb02ea86a9f71 /sway/desktop/transaction.c
parent53e3f35ba348d6285478ceb4a93b020e138c95c7 (diff)
parenta120d4c79f9406a2f7cc38c60069d3183c98ea87 (diff)
Merge pull request #2275 from RyanDwyer/transactionise-focus
Make focus part of transactions
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r--sway/desktop/transaction.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 0ae042db..fcfb0b51 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -139,6 +139,14 @@ static void copy_pending_state(struct sway_container *container,
state->children = create_list();
list_cat(state->children, container->children);
}
+
+ struct sway_seat *seat = input_manager_current_seat(input_manager);
+ state->focused = seat_get_focus(seat) == container;
+
+ if (container->type != C_VIEW) {
+ state->focused_inactive_child =
+ seat_get_active_child(seat, container);
+ }
}
static void transaction_add_container(struct sway_transaction *transaction,
@@ -195,10 +203,12 @@ static void transaction_apply(struct sway_transaction *transaction) {
.width = instruction->state.swayc_width,
.height = instruction->state.swayc_height,
};
- for (int j = 0; j < root_container.children->length; ++j) {
- struct sway_container *output = root_container.children->items[j];
- output_damage_box(output->sway_output, &old_box);
- output_damage_box(output->sway_output, &new_box);
+ for (int j = 0; j < root_container.current.children->length; ++j) {
+ struct sway_container *output = root_container.current.children->items[j];
+ if (output->sway_output) {
+ output_damage_box(output->sway_output, &old_box);
+ output_damage_box(output->sway_output, &new_box);
+ }
}
// There are separate children lists for each instruction state, the