diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 10 | ||||
-rw-r--r-- | sway/config.c | 1 | ||||
-rw-r--r-- | sway/handlers.c | 2 |
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) { return CMD_SUCCESS; } +static enum cmd_status cmd_seamless_mouse(int argc, char **argv) { + if (!checkarg(argc, "seamless_mouse", EXPECTED_EQUAL_TO, 1)) { + return CMD_FAILURE; + } + + config->seamless_mouse = (strcasecmp(argv[0], "on") == 0 || strcasecmp(argv[0], "yes") == 0); + return CMD_SUCCESS; +} + static void hide_view_in_scratchpad(swayc_t *sp_view) { if (sp_view == NULL) { return; @@ -1139,6 +1148,7 @@ static struct cmd_handler handlers[] = { { "reload", cmd_reload }, { "resize", cmd_resize }, { "scratchpad", cmd_scratchpad }, + { "seamless_mouse", cmd_seamless_mouse }, { "set", cmd_set }, { "split", cmd_split }, { "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) { config->active = false; config->failed = false; config->auto_back_and_forth = false; + config->seamless_mouse = true; config->reading = false; 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 // // Since this doesn't currently support moving windows between outputs we // don't do the switch if the pointer is in a mode. - if (!pointer_state.mode) { + if (config->seamless_mouse && !pointer_state.mode) { swayc_t *output = swayc_active_output(); // TODO: This implementation is naïve: We assume all outputs are |