aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-server.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/ipc-server.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/ipc-server.c')
-rw-r--r--sway/ipc-server.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index c5161a6b..be703915 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -18,6 +18,7 @@
18#include <wayland-server.h> 18#include <wayland-server.h>
19#include "sway/commands.h" 19#include "sway/commands.h"
20#include "sway/config.h" 20#include "sway/config.h"
21#include "sway/desktop/transaction.h"
21#include "sway/ipc-json.h" 22#include "sway/ipc-json.h"
22#include "sway/ipc-server.h" 23#include "sway/ipc-server.h"
23#include "sway/output.h" 24#include "sway/output.h"
@@ -484,6 +485,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
484 case IPC_COMMAND: 485 case IPC_COMMAND:
485 { 486 {
486 struct cmd_results *results = execute_command(buf, NULL); 487 struct cmd_results *results = execute_command(buf, NULL);
488 transaction_commit_dirty();
487 char *json = cmd_results_to_json(results); 489 char *json = cmd_results_to_json(results);
488 int length = strlen(json); 490 int length = strlen(json);
489 client_valid = ipc_send_reply(client, json, (uint32_t)length); 491 client_valid = ipc_send_reply(client, json, (uint32_t)length);