aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-07-09 02:57:59 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2019-07-09 10:00:57 +0300
commit152e30c374382eecccb917e5c26d72a2ea53ef87 (patch)
tree9baab29c015d6246c0a00e1d596c54ced0e7384b /sway/config.c
parentMake mouse drag in tiled mode swap containers if no edge is selected (diff)
downloadsway-152e30c374382eecccb917e5c26d72a2ea53ef87.tar.gz
sway-152e30c374382eecccb917e5c26d72a2ea53ef87.tar.zst
sway-152e30c374382eecccb917e5c26d72a2ea53ef87.zip
cmd_bindswitch: add option to execute on reload
This adds a --reload flag to cmd_bindswitch that allows for the binding to be executed on reload. One possible use case for this is to allow users to disable outputs when the lid closes and enable them when the lid opens without having to open and re-close the lid after a reload.
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sway/config.c b/sway/config.c
index 70f2d706..74080898 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -17,6 +17,7 @@
17#include <wlr/types/wlr_output.h> 17#include <wlr/types/wlr_output.h>
18#include "sway/input/input-manager.h" 18#include "sway/input/input-manager.h"
19#include "sway/input/seat.h" 19#include "sway/input/seat.h"
20#include "sway/input/switch.h"
20#include "sway/commands.h" 21#include "sway/commands.h"
21#include "sway/config.h" 22#include "sway/config.h"
22#include "sway/criteria.h" 23#include "sway/criteria.h"
@@ -520,6 +521,12 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
520 } 521 }
521 522
522 if (is_active) { 523 if (is_active) {
524 input_manager_verify_fallback_seat();
525 for (int i = 0; i < config->seat_configs->length; i++) {
526 input_manager_apply_seat_config(config->seat_configs->items[i]);
527 }
528 sway_switch_retrigger_bindings_for_all();
529
523 reset_outputs(); 530 reset_outputs();
524 spawn_swaybg(); 531 spawn_swaybg();
525 532
@@ -527,11 +534,6 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
527 if (config->swaynag_config_errors.client != NULL) { 534 if (config->swaynag_config_errors.client != NULL) {
528 swaynag_show(&config->swaynag_config_errors); 535 swaynag_show(&config->swaynag_config_errors);
529 } 536 }
530
531 input_manager_verify_fallback_seat();
532 for (int i = 0; i < config->seat_configs->length; i++) {
533 input_manager_apply_seat_config(config->seat_configs->items[i]);
534 }
535 } 537 }
536 538
537 if (old_config) { 539 if (old_config) {