diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-02 16:09:27 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-02 16:09:27 -0400 |
commit | d434da563239c43c5fe417ce83b23b417f2ab635 (patch) | |
tree | e154daaf43c42d11c5afb8b7739ae6b52dd01215 /sway/commands | |
parent | fix workspace splits (diff) | |
parent | Merge pull request #1699 from acrisci/seat-fixes (diff) | |
download | sway-d434da563239c43c5fe417ce83b23b417f2ab635.tar.gz sway-d434da563239c43c5fe417ce83b23b417f2ab635.tar.zst sway-d434da563239c43c5fe417ce83b23b417f2ab635.zip |
Merge branch 'wlroots' into split-containers
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/focus.c | 4 | ||||
-rw-r--r-- | sway/commands/move.c | 8 | ||||
-rw-r--r-- | sway/commands/seat.c | 11 | ||||
-rw-r--r-- | sway/commands/workspace.c | 2 |
4 files changed, 15 insertions, 10 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 0a521b9e..74d9d535 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c | |||
@@ -36,7 +36,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) { | |||
36 | } | 36 | } |
37 | 37 | ||
38 | if (argc == 0) { | 38 | if (argc == 0) { |
39 | sway_seat_set_focus(seat, con); | 39 | seat_set_focus(seat, con); |
40 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 40 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
41 | } | 41 | } |
42 | 42 | ||
@@ -50,7 +50,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) { | |||
50 | struct sway_container *next_focus = container_get_in_direction( | 50 | struct sway_container *next_focus = container_get_in_direction( |
51 | con, seat, direction); | 51 | con, seat, direction); |
52 | if (next_focus) { | 52 | if (next_focus) { |
53 | sway_seat_set_focus(seat, next_focus); | 53 | seat_set_focus(seat, next_focus); |
54 | } | 54 | } |
55 | 55 | ||
56 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 56 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
diff --git a/sway/commands/move.c b/sway/commands/move.c index ab959b77..644c622b 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -78,10 +78,10 @@ static struct cmd_results *cmd_move_container(struct sway_container *current, | |||
78 | } | 78 | } |
79 | free(ws_name); | 79 | free(ws_name); |
80 | struct sway_container *old_parent = current->parent; | 80 | struct sway_container *old_parent = current->parent; |
81 | struct sway_container *focus = sway_seat_get_focus_inactive( | 81 | struct sway_container *focus = seat_get_focus_inactive( |
82 | config->handler_context.seat, ws); | 82 | config->handler_context.seat, ws); |
83 | container_move_to(current, focus); | 83 | container_move_to(current, focus); |
84 | sway_seat_set_focus(config->handler_context.seat, old_parent); | 84 | seat_set_focus(config->handler_context.seat, old_parent); |
85 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 85 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
86 | } else if (strcasecmp(argv[1], "to") == 0 | 86 | } else if (strcasecmp(argv[1], "to") == 0 |
87 | && strcasecmp(argv[2], "output") == 0) { | 87 | && strcasecmp(argv[2], "output") == 0) { |
@@ -100,7 +100,7 @@ static struct cmd_results *cmd_move_container(struct sway_container *current, | |||
100 | return cmd_results_new(CMD_FAILURE, "move workspace", | 100 | return cmd_results_new(CMD_FAILURE, "move workspace", |
101 | "Can't find output with name/direction '%s'", argv[3]); | 101 | "Can't find output with name/direction '%s'", argv[3]); |
102 | } | 102 | } |
103 | struct sway_container *focus = sway_seat_get_focus_inactive( | 103 | struct sway_container *focus = seat_get_focus_inactive( |
104 | config->handler_context.seat, destination); | 104 | config->handler_context.seat, destination); |
105 | if (!focus) { | 105 | if (!focus) { |
106 | // We've never been to this output before | 106 | // We've never been to this output before |
@@ -108,7 +108,7 @@ static struct cmd_results *cmd_move_container(struct sway_container *current, | |||
108 | } | 108 | } |
109 | struct sway_container *old_parent = current->parent; | 109 | struct sway_container *old_parent = current->parent; |
110 | container_move_to(current, focus); | 110 | container_move_to(current, focus); |
111 | sway_seat_set_focus(config->handler_context.seat, old_parent); | 111 | seat_set_focus(config->handler_context.seat, old_parent); |
112 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 112 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
113 | } | 113 | } |
114 | return cmd_results_new(CMD_INVALID, "move", expected_syntax); | 114 | return cmd_results_new(CMD_INVALID, "move", expected_syntax); |
diff --git a/sway/commands/seat.c b/sway/commands/seat.c index 45079616..819b769c 100644 --- a/sway/commands/seat.c +++ b/sway/commands/seat.c | |||
@@ -14,7 +14,8 @@ struct cmd_results *cmd_seat(int argc, char **argv) { | |||
14 | free_seat_config(config->handler_context.seat_config); | 14 | free_seat_config(config->handler_context.seat_config); |
15 | config->handler_context.seat_config = new_seat_config(argv[0]); | 15 | config->handler_context.seat_config = new_seat_config(argv[0]); |
16 | if (!config->handler_context.seat_config) { | 16 | if (!config->handler_context.seat_config) { |
17 | return cmd_results_new(CMD_FAILURE, NULL, "Couldn't allocate config"); | 17 | return cmd_results_new(CMD_FAILURE, NULL, |
18 | "Couldn't allocate config"); | ||
18 | } | 19 | } |
19 | wlr_log(L_DEBUG, "entering seat block: %s", argv[0]); | 20 | wlr_log(L_DEBUG, "entering seat block: %s", argv[0]); |
20 | return cmd_results_new(CMD_BLOCK_SEAT, NULL, NULL); | 21 | return cmd_results_new(CMD_BLOCK_SEAT, NULL, NULL); |
@@ -28,7 +29,8 @@ struct cmd_results *cmd_seat(int argc, char **argv) { | |||
28 | if (!has_context) { | 29 | if (!has_context) { |
29 | config->handler_context.seat_config = new_seat_config(argv[0]); | 30 | config->handler_context.seat_config = new_seat_config(argv[0]); |
30 | if (!config->handler_context.seat_config) { | 31 | if (!config->handler_context.seat_config) { |
31 | return cmd_results_new(CMD_FAILURE, NULL, "Couldn't allocate config"); | 32 | return cmd_results_new(CMD_FAILURE, NULL, |
33 | "Couldn't allocate config"); | ||
32 | } | 34 | } |
33 | } | 35 | } |
34 | 36 | ||
@@ -41,7 +43,10 @@ struct cmd_results *cmd_seat(int argc, char **argv) { | |||
41 | } else if (strcasecmp("fallback", argv[1]) == 0) { | 43 | } else if (strcasecmp("fallback", argv[1]) == 0) { |
42 | res = seat_cmd_fallback(argc_new, argv_new); | 44 | res = seat_cmd_fallback(argc_new, argv_new); |
43 | } else { | 45 | } else { |
44 | res = cmd_results_new(CMD_INVALID, "seat <name>", "Unknown command %s", argv[1]); | 46 | res = |
47 | cmd_results_new(CMD_INVALID, | ||
48 | "seat <name>", "Unknown command %s", | ||
49 | argv[1]); | ||
45 | } | 50 | } |
46 | 51 | ||
47 | if (!has_context) { | 52 | if (!has_context) { |
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index 8f39e5fc..aa4096f7 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c | |||
@@ -91,7 +91,7 @@ struct cmd_results *cmd_workspace(int argc, char **argv) { | |||
91 | } | 91 | } |
92 | workspace_switch(ws); | 92 | workspace_switch(ws); |
93 | current_container = | 93 | current_container = |
94 | sway_seat_get_focus(config->handler_context.seat); | 94 | seat_get_focus(config->handler_context.seat); |
95 | struct sway_container *new_output = container_parent(current_container, C_OUTPUT); | 95 | struct sway_container *new_output = container_parent(current_container, C_OUTPUT); |
96 | 96 | ||
97 | if (config->mouse_warping && old_output != new_output) { | 97 | if (config->mouse_warping && old_output != new_output) { |