summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-10-22 01:34:32 +0200
committerLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-10-22 01:39:12 +0200
commitedf33aad29f142c08ad8ecbac7fb859c92d128e3 (patch)
tree49c85672cf9ba8e0fa08994b27b8f37c73be4022 /sway
parentSwitch to adjacent output when hitting output edge. (diff)
downloadsway-edf33aad29f142c08ad8ecbac7fb859c92d128e3.tar.gz
sway-edf33aad29f142c08ad8ecbac7fb859c92d128e3.tar.zst
sway-edf33aad29f142c08ad8ecbac7fb859c92d128e3.zip
config: Add "seamless_mouse" to decide if pointer crosses output edges.
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c10
-rw-r--r--sway/config.c1
-rw-r--r--sway/handlers.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 7605a36b..a9c20e51 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -410,6 +410,15 @@ static enum cmd_status cmd_focus_follows_mouse(int argc, char **argv) {
410 return CMD_SUCCESS; 410 return CMD_SUCCESS;
411} 411}
412 412
413static enum cmd_status cmd_seamless_mouse(int argc, char **argv) {
414 if (!checkarg(argc, "seamless_mouse", EXPECTED_EQUAL_TO, 1)) {
415 return CMD_FAILURE;
416 }
417
418 config->seamless_mouse = (strcasecmp(argv[0], "on") == 0 || strcasecmp(argv[0], "yes") == 0);
419 return CMD_SUCCESS;
420}
421
413static void hide_view_in_scratchpad(swayc_t *sp_view) { 422static void hide_view_in_scratchpad(swayc_t *sp_view) {
414 if (sp_view == NULL) { 423 if (sp_view == NULL) {
415 return; 424 return;
@@ -1139,6 +1148,7 @@ static struct cmd_handler handlers[] = {
1139 { "reload", cmd_reload }, 1148 { "reload", cmd_reload },
1140 { "resize", cmd_resize }, 1149 { "resize", cmd_resize },
1141 { "scratchpad", cmd_scratchpad }, 1150 { "scratchpad", cmd_scratchpad },
1151 { "seamless_mouse", cmd_seamless_mouse },
1142 { "set", cmd_set }, 1152 { "set", cmd_set },
1143 { "split", cmd_split }, 1153 { "split", cmd_split },
1144 { "splith", cmd_splith }, 1154 { "splith", cmd_splith },
diff --git a/sway/config.c b/sway/config.c
index bce074b9..67f8284c 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -102,6 +102,7 @@ static void config_defaults(struct sway_config *config) {
102 config->active = false; 102 config->active = false;
103 config->failed = false; 103 config->failed = false;
104 config->auto_back_and_forth = false; 104 config->auto_back_and_forth = false;
105 config->seamless_mouse = true;
105 config->reading = false; 106 config->reading = false;
106 107
107 config->gaps_inner = 0; 108 config->gaps_inner = 0;
diff --git a/sway/handlers.c b/sway/handlers.c
index 4b6aaedd..351d0a0f 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -357,7 +357,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
357 // 357 //
358 // Since this doesn't currently support moving windows between outputs we 358 // Since this doesn't currently support moving windows between outputs we
359 // don't do the switch if the pointer is in a mode. 359 // don't do the switch if the pointer is in a mode.
360 if (!pointer_state.mode) { 360 if (config->seamless_mouse && !pointer_state.mode) {
361 swayc_t *output = swayc_active_output(); 361 swayc_t *output = swayc_active_output();
362 362
363 // TODO: This implementation is naïve: We assume all outputs are 363 // TODO: This implementation is naïve: We assume all outputs are