diff options
author | Rouven Czerwinski <rouven@czerwinskis.de> | 2018-10-10 11:28:37 +0200 |
---|---|---|
committer | Rouven Czerwinski <rouven@czerwinskis.de> | 2018-10-10 12:45:21 +0200 |
commit | 41991542cac1d909a55fc834d231fe747097b1a4 (patch) | |
tree | 0e0eba7984d8e98b70c29159a2792ec1e39b9351 /sway/commands | |
parent | Merge pull request #2812 from RyanDwyer/fix-version-messages (diff) | |
download | sway-41991542cac1d909a55fc834d231fe747097b1a4.tar.gz sway-41991542cac1d909a55fc834d231fe747097b1a4.tar.zst sway-41991542cac1d909a55fc834d231fe747097b1a4.zip |
Add mouse_warping container
This option always moves the cursor into the middle of the container if the warp
variable is true in seat_set_focus_warp.
Fixes #2577
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/mouse_warping.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/commands/mouse_warping.c b/sway/commands/mouse_warping.c index eef32ce7..d067bc65 100644 --- a/sway/commands/mouse_warping.c +++ b/sway/commands/mouse_warping.c | |||
@@ -6,13 +6,15 @@ struct cmd_results *cmd_mouse_warping(int argc, char **argv) { | |||
6 | struct cmd_results *error = NULL; | 6 | struct cmd_results *error = NULL; |
7 | if ((error = checkarg(argc, "mouse_warping", EXPECTED_EQUAL_TO, 1))) { | 7 | if ((error = checkarg(argc, "mouse_warping", EXPECTED_EQUAL_TO, 1))) { |
8 | return error; | 8 | return error; |
9 | } else if (strcasecmp(argv[0], "container") == 0) { | ||
10 | config->mouse_warping = WARP_CONTAINER; | ||
9 | } else if (strcasecmp(argv[0], "output") == 0) { | 11 | } else if (strcasecmp(argv[0], "output") == 0) { |
10 | config->mouse_warping = true; | 12 | config->mouse_warping = WARP_OUTPUT; |
11 | } else if (strcasecmp(argv[0], "none") == 0) { | 13 | } else if (strcasecmp(argv[0], "none") == 0) { |
12 | config->mouse_warping = false; | 14 | config->mouse_warping = WARP_NO; |
13 | } else { | 15 | } else { |
14 | return cmd_results_new(CMD_FAILURE, "mouse_warping", | 16 | return cmd_results_new(CMD_FAILURE, "mouse_warping", |
15 | "Expected 'mouse_warping output|none'"); | 17 | "Expected 'mouse_warping output|container|none'"); |
16 | } | 18 | } |
17 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 19 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
18 | } | 20 | } |