aboutsummaryrefslogtreecommitdiffstats
path: root/sway/main.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-06-11 21:41:02 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2019-06-12 07:56:41 +0300
commit9670ccee683ab985e89eb04302fb998c4161f2d6 (patch)
treef7cafeaf55a7c139e97a920b0b43bcb080d3a27c /sway/main.c
parentFix segfaults caused by faulty command parsing (diff)
downloadsway-9670ccee683ab985e89eb04302fb998c4161f2d6.tar.gz
sway-9670ccee683ab985e89eb04302fb998c4161f2d6.tar.zst
sway-9670ccee683ab985e89eb04302fb998c4161f2d6.zip
bindings: defer while initiailizing
This adds the logic to defer binding execution while sway is still initializing. Without this, the binding command would be executed, but the command handler would return CMD_DEFER, which was being treated as a failure to run. To avoid partial executions, this will defer all bindings while config->active is false.
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/main.c b/sway/main.c
index 0477bbc3..9ddbea81 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -16,6 +16,7 @@
16#include "sway/config.h" 16#include "sway/config.h"
17#include "sway/server.h" 17#include "sway/server.h"
18#include "sway/swaynag.h" 18#include "sway/swaynag.h"
19#include "sway/desktop/transaction.h"
19#include "sway/tree/root.h" 20#include "sway/tree/root.h"
20#include "sway/ipc-server.h" 21#include "sway/ipc-server.h"
21#include "ipc-client.h" 22#include "ipc-client.h"
@@ -389,6 +390,8 @@ int main(int argc, char **argv) {
389 config->active = true; 390 config->active = true;
390 load_swaybars(); 391 load_swaybars();
391 run_deferred_commands(); 392 run_deferred_commands();
393 run_deferred_bindings();
394 transaction_commit_dirty();
392 395
393 if (config->swaynag_config_errors.client != NULL) { 396 if (config->swaynag_config_errors.client != NULL) {
394 swaynag_show(&config->swaynag_config_errors); 397 swaynag_show(&config->swaynag_config_errors);