summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/border.c4
-rw-r--r--sway/commands.c8
-rw-r--r--sway/focus.c2
-rw-r--r--sway/layout.c4
-rw-r--r--sway/sway.5.txt4
5 files changed, 15 insertions, 7 deletions
diff --git a/sway/border.c b/sway/border.c
index 55628972..d17d8d0c 100644
--- a/sway/border.c
+++ b/sway/border.c
@@ -281,7 +281,9 @@ void update_tabbed_stacked_titlebars(swayc_t *c, cairo_t *cr, struct wlc_geometr
281 update_tabbed_stacked_titlebars(child, cr, g, focused, focused_inactive); 281 update_tabbed_stacked_titlebars(child, cr, g, focused, focused_inactive);
282 } 282 }
283 } else { 283 } else {
284 if (focused == c) { 284 bool is_child_of_focused = swayc_is_child_of(c, get_focused_container(&root_container));
285
286 if (focused == c || is_child_of_focused) {
285 render_title_bar(c, cr, g, &config->border_colors.focused); 287 render_title_bar(c, cr, g, &config->border_colors.focused);
286 } else if (focused_inactive == c) { 288 } else if (focused_inactive == c) {
287 render_title_bar(c, cr, g, &config->border_colors.focused_inactive); 289 render_title_bar(c, cr, g, &config->border_colors.focused_inactive);
diff --git a/sway/commands.c b/sway/commands.c
index ed561764..d572afa0 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -864,6 +864,8 @@ static struct cmd_results *cmd_focus(int argc, char **argv) {
864 move_focus(MOVE_DOWN); 864 move_focus(MOVE_DOWN);
865 } else if (strcasecmp(argv[0], "parent") == 0) { 865 } else if (strcasecmp(argv[0], "parent") == 0) {
866 move_focus(MOVE_PARENT); 866 move_focus(MOVE_PARENT);
867 } else if (strcasecmp(argv[0], "child") == 0) {
868 move_focus(MOVE_CHILD);
867 } else if (strcasecmp(argv[0], "mode_toggle") == 0) { 869 } else if (strcasecmp(argv[0], "mode_toggle") == 0) {
868 int i; 870 int i;
869 swayc_t *workspace = swayc_active_workspace(); 871 swayc_t *workspace = swayc_active_workspace();
@@ -903,7 +905,7 @@ static struct cmd_results *cmd_focus(int argc, char **argv) {
903 } 905 }
904 } else { 906 } else {
905 return cmd_results_new(CMD_INVALID, "focus", 907 return cmd_results_new(CMD_INVALID, "focus",
906 "Expected 'focus <direction|parent|mode_toggle>' or 'focus output <direction|name>'"); 908 "Expected 'focus <direction|parent|child|mode_toggle>' or 'focus output <direction|name>'");
907 } 909 }
908 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 910 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
909} 911}
@@ -1925,8 +1927,8 @@ static struct cmd_results *cmd_kill(int argc, char **argv) {
1925 if (config->reading) return cmd_results_new(CMD_FAILURE, "kill", "Can't be used in config file."); 1927 if (config->reading) return cmd_results_new(CMD_FAILURE, "kill", "Can't be used in config file.");
1926 if (!config->active) return cmd_results_new(CMD_FAILURE, "kill", "Can only be used when sway is running."); 1928 if (!config->active) return cmd_results_new(CMD_FAILURE, "kill", "Can only be used when sway is running.");
1927 1929
1928 swayc_t *view = get_focused_container(&root_container); 1930 swayc_t *container = get_focused_container(&root_container);
1929 wlc_view_close(view->handle); 1931 close_views(container);
1930 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1932 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
1931} 1933}
1932 1934
diff --git a/sway/focus.c b/sway/focus.c
index c7737a1d..0f629e1e 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -72,7 +72,7 @@ bool move_focus(enum movement_direction direction) {
72 return false; 72 return false;
73 } else if (new_view->type == C_OUTPUT) { 73 } else if (new_view->type == C_OUTPUT) {
74 return set_focused_container(swayc_active_workspace_for(new_view)); 74 return set_focused_container(swayc_active_workspace_for(new_view));
75 } else if (direction == MOVE_PARENT) { 75 } else if (direction == MOVE_PARENT || direction == MOVE_CHILD) {
76 return set_focused_container(new_view); 76 return set_focused_container(new_view);
77 } else if (config->mouse_warping) { 77 } else if (config->mouse_warping) {
78 swayc_t *old_op = old_view->type == C_OUTPUT ? 78 swayc_t *old_op = old_view->type == C_OUTPUT ?
diff --git a/sway/layout.c b/sway/layout.c
index 1a046da4..fc7a31b4 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -1011,6 +1011,10 @@ static swayc_t *get_swayc_in_output_direction(swayc_t *output, enum movement_dir
1011} 1011}
1012 1012
1013swayc_t *get_swayc_in_direction_under(swayc_t *container, enum movement_direction dir, swayc_t *limit) { 1013swayc_t *get_swayc_in_direction_under(swayc_t *container, enum movement_direction dir, swayc_t *limit) {
1014 if (dir == MOVE_CHILD) {
1015 return container->focused;
1016 }
1017
1014 swayc_t *parent = container->parent; 1018 swayc_t *parent = container->parent;
1015 if (dir == MOVE_PARENT) { 1019 if (dir == MOVE_PARENT) {
1016 if (parent->type == C_OUTPUT) { 1020 if (parent->type == C_OUTPUT) {
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index 18b693f8..fdf5c0c1 100644
--- a/sway/sway.5.txt
+++ b/sway/sway.5.txt
@@ -59,8 +59,8 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
59 Make focused view floating, non-floating, or the opposite of what it is now. 59 Make focused view floating, non-floating, or the opposite of what it is now.
60 60
61**focus** <direction>:: 61**focus** <direction>::
62 Direction may be one of _up_, _down_, _left_, _right_, or _parent_. The 62 Direction may be one of _up_, _down_, _left_, _right_, _parent_, or _child_.
63 directional focus commands will move the focus in that direction. The parent 63 The directional focus commands will move the focus in that direction. The parent
64 focus command will change the focus to the parent of the currently focused 64 focus command will change the focus to the parent of the currently focused
65 container, which is useful, for example, to open a sibling of the parent 65 container, which is useful, for example, to open a sibling of the parent
66 container, or to move the entire container around. 66 container, or to move the entire container around.