aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/focus.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2019-01-25 08:29:21 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2019-01-25 08:29:21 +1000
commit20aa8ee67dc528299dbc8735220a1c081c7ff9f6 (patch)
tree685de48be3db51fc01510ccf051e2b63a4655fba /sway/commands/focus.c
parentUpdate for swaywm/wlroots#1402 (diff)
downloadsway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.gz
sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.zst
sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.zip
Implement fullscreen global
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r--sway/commands/focus.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 0622f2e8..87fe6cf3 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -89,19 +89,23 @@ static struct sway_node *get_node_in_output_direction(
89 89
90static struct sway_node *node_get_in_direction(struct sway_container *container, 90static struct sway_node *node_get_in_direction(struct sway_container *container,
91 struct sway_seat *seat, enum wlr_direction dir) { 91 struct sway_seat *seat, enum wlr_direction dir) {
92 if (container->is_fullscreen) {
93 // Fullscreen container with a direction - go straight to outputs
94 struct sway_output *output = container->workspace->output;
95 struct sway_output *new_output = output_get_in_direction(output, dir);
96 if (!new_output) {
97 return NULL;
98 }
99 return get_node_in_output_direction(new_output, dir);
100 }
101
102 struct sway_container *wrap_candidate = NULL; 92 struct sway_container *wrap_candidate = NULL;
103 struct sway_container *current = container; 93 struct sway_container *current = container;
104 while (current) { 94 while (current) {
95 if (current->fullscreen_mode == FULLSCREEN_WORKSPACE) {
96 // Fullscreen container with a direction - go straight to outputs
97 struct sway_output *output = current->workspace->output;
98 struct sway_output *new_output =
99 output_get_in_direction(output, dir);
100 if (!new_output) {
101 return NULL;
102 }
103 return get_node_in_output_direction(new_output, dir);
104 }
105 if (current->fullscreen_mode == FULLSCREEN_GLOBAL) {
106 return NULL;
107 }
108
105 bool can_move = false; 109 bool can_move = false;
106 int desired; 110 int desired;
107 int idx = container_sibling_index(current); 111 int idx = container_sibling_index(current);
@@ -227,7 +231,7 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
227static struct cmd_results *focus_parent(void) { 231static struct cmd_results *focus_parent(void) {
228 struct sway_seat *seat = config->handler_context.seat; 232 struct sway_seat *seat = config->handler_context.seat;
229 struct sway_container *con = config->handler_context.container; 233 struct sway_container *con = config->handler_context.container;
230 if (!con || con->is_fullscreen) { 234 if (!con || con->fullscreen_mode) {
231 return cmd_results_new(CMD_SUCCESS, NULL); 235 return cmd_results_new(CMD_SUCCESS, NULL);
232 } 236 }
233 struct sway_node *parent = node_get_parent(&con->node); 237 struct sway_node *parent = node_get_parent(&con->node);