aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/input
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-22 01:16:23 +0100
committerGitHub <noreply@github.com>2018-01-22 01:16:23 +0100
commit0c58673c6a108ba241419a0f1d5fecd47f22370e (patch)
treec3e19af6dd70f04fc5c617e932b4afcc7a1b41d9 /sway/commands/input
parenta6bc46eea9d7dec6a2b93f85bac2e3737e0c6725 (diff)
parentbeb3805cf0300bc2640290233aa763d757c12466 (diff)
Merge pull request #1574 from acrisci/config-refactor
Command criteria
Diffstat (limited to 'sway/commands/input')
-rw-r--r--sway/commands/input/accel_profile.c2
-rw-r--r--sway/commands/input/click_method.c4
-rw-r--r--sway/commands/input/drag_lock.c2
-rw-r--r--sway/commands/input/dwt.c2
-rw-r--r--sway/commands/input/events.c6
-rw-r--r--sway/commands/input/left_handed.c2
-rw-r--r--sway/commands/input/middle_emulation.c2
-rw-r--r--sway/commands/input/natural_scroll.c2
-rw-r--r--sway/commands/input/pointer_accel.c2
-rw-r--r--sway/commands/input/scroll_method.c2
-rw-r--r--sway/commands/input/tap.c3
-rw-r--r--sway/commands/input/xkb_layout.c3
-rw-r--r--sway/commands/input/xkb_model.c3
-rw-r--r--sway/commands/input/xkb_options.c3
-rw-r--r--sway/commands/input/xkb_rules.c3
-rw-r--r--sway/commands/input/xkb_variant.c3
16 files changed, 34 insertions, 10 deletions
diff --git a/sway/commands/input/accel_profile.c b/sway/commands/input/accel_profile.c
index f72b7d48..37d6e133 100644
--- a/sway/commands/input/accel_profile.c
+++ b/sway/commands/input/accel_profile.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_accel_profile(int argc, char **argv) {
if ((error = checkarg(argc, "accel_profile", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "accel_profile",
"No input device defined.");
diff --git a/sway/commands/input/click_method.c b/sway/commands/input/click_method.c
index 22eb15f7..8f1f0aa7 100644
--- a/sway/commands/input/click_method.c
+++ b/sway/commands/input/click_method.c
@@ -6,12 +6,12 @@
#include "log.h"
struct cmd_results *input_cmd_click_method(int argc, char **argv) {
- wlr_log(L_DEBUG, "click_method for device: %d %s",
- current_input_config==NULL, current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "click_method",
"No input device defined.");
diff --git a/sway/commands/input/drag_lock.c b/sway/commands/input/drag_lock.c
index 1783978a..8273a7d4 100644
--- a/sway/commands/input/drag_lock.c
+++ b/sway/commands/input/drag_lock.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_drag_lock(int argc, char **argv) {
if ((error = checkarg(argc, "drag_lock", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE,
"drag_lock", "No input device defined.");
diff --git a/sway/commands/input/dwt.c b/sway/commands/input/dwt.c
index 8108a110..995a2f47 100644
--- a/sway/commands/input/dwt.c
+++ b/sway/commands/input/dwt.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_dwt(int argc, char **argv) {
if ((error = checkarg(argc, "dwt", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "dwt", "No input device defined.");
}
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c
index a1bfbacd..2217f5ce 100644
--- a/sway/commands/input/events.c
+++ b/sway/commands/input/events.c
@@ -6,16 +6,18 @@
#include "log.h"
struct cmd_results *input_cmd_events(int argc, char **argv) {
- wlr_log(L_DEBUG, "events for device: %s",
- current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "events",
"No input device defined.");
}
+ wlr_log(L_DEBUG, "events for device: %s",
+ current_input_config->identifier);
struct input_config *new_config =
new_input_config(current_input_config->identifier);
diff --git a/sway/commands/input/left_handed.c b/sway/commands/input/left_handed.c
index 35740df3..94b8e03e 100644
--- a/sway/commands/input/left_handed.c
+++ b/sway/commands/input/left_handed.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_left_handed(int argc, char **argv) {
if ((error = checkarg(argc, "left_handed", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "left_handed",
"No input device defined.");
diff --git a/sway/commands/input/middle_emulation.c b/sway/commands/input/middle_emulation.c
index 7bc08ae6..a551fd51 100644
--- a/sway/commands/input/middle_emulation.c
+++ b/sway/commands/input/middle_emulation.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) {
if ((error = checkarg(argc, "middle_emulation", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "middle_emulation",
"No input device defined.");
diff --git a/sway/commands/input/natural_scroll.c b/sway/commands/input/natural_scroll.c
index a7dcdc2c..c4e19b78 100644
--- a/sway/commands/input/natural_scroll.c
+++ b/sway/commands/input/natural_scroll.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_natural_scroll(int argc, char **argv) {
if ((error = checkarg(argc, "natural_scroll", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "natural_scoll",
"No input device defined.");
diff --git a/sway/commands/input/pointer_accel.c b/sway/commands/input/pointer_accel.c
index d2261a63..171063aa 100644
--- a/sway/commands/input/pointer_accel.c
+++ b/sway/commands/input/pointer_accel.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_pointer_accel(int argc, char **argv) {
if ((error = checkarg(argc, "pointer_accel", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE,
"pointer_accel", "No input device defined.");
diff --git a/sway/commands/input/scroll_method.c b/sway/commands/input/scroll_method.c
index 035262cf..0a1c57ac 100644
--- a/sway/commands/input/scroll_method.c
+++ b/sway/commands/input/scroll_method.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_scroll_method(int argc, char **argv) {
if ((error = checkarg(argc, "scroll_method", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "scroll_method",
"No input device defined.");
diff --git a/sway/commands/input/tap.c b/sway/commands/input/tap.c
index ecab9a5b..e7f03058 100644
--- a/sway/commands/input/tap.c
+++ b/sway/commands/input/tap.c
@@ -6,11 +6,12 @@
#include "log.h"
struct cmd_results *input_cmd_tap(int argc, char **argv) {
- wlr_log(L_DEBUG, "tap for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "tap", "No input device defined.");
}
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c
index 25db1a33..867e65d3 100644
--- a/sway/commands/input/xkb_layout.c
+++ b/sway/commands/input/xkb_layout.c
@@ -5,11 +5,12 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
- wlr_log(L_DEBUG, "xkb layout for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_layout", EXPECTED_EQUAL_TO, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "xkb_layout", "No input device defined.");
}
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c
index 819b796b..e8c8e04e 100644
--- a/sway/commands/input/xkb_model.c
+++ b/sway/commands/input/xkb_model.c
@@ -5,11 +5,12 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
- wlr_log(L_DEBUG, "xkb model for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "xkb_model", "No input device defined.");
}
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c
index ff5f83ec..e9ddd6e3 100644
--- a/sway/commands/input/xkb_options.c
+++ b/sway/commands/input/xkb_options.c
@@ -5,11 +5,12 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
- wlr_log(L_DEBUG, "xkb options for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "xkb_options", "No input device defined.");
}
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c
index aafe0003..926d0ac1 100644
--- a/sway/commands/input/xkb_rules.c
+++ b/sway/commands/input/xkb_rules.c
@@ -5,11 +5,12 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
- wlr_log(L_DEBUG, "xkb rules for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "xkb_rules", "No input device defined.");
}
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c
index 89a61fdc..0e3ffd41 100644
--- a/sway/commands/input/xkb_variant.c
+++ b/sway/commands/input/xkb_variant.c
@@ -5,11 +5,12 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
- wlr_log(L_DEBUG, "xkb variant for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_variant", EXPECTED_EQUAL_TO, 1))) {
return error;
}
+ struct input_config *current_input_config =
+ config->handler_context.input_config;
if (!current_input_config) {
return cmd_results_new(CMD_FAILURE, "xkb_variant", "No input device defined.");
}