From 908095ef9a479cafaf7d815824f243b4576ff1bb Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 6 Sep 2018 19:26:56 +1000 Subject: Introduce seat_set_focus_container and seat_set_focus_workspace These are the same as seat_set_focus, but accept a specific type rather than using nodes. Doing this adds more typesafety and lets us avoid using &con->node which looks a little ugly. This fixes a crash that pretty much nobody would ever come across. If you have a bindsym for "focus" with no arguments and run it from an empty workspace, sway would crash because it assumes `container` is not NULL. --- sway/commands/fullscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/commands/fullscreen.c') diff --git a/sway/commands/fullscreen.c b/sway/commands/fullscreen.c index 3bbe00c5..22d747b9 100644 --- a/sway/commands/fullscreen.c +++ b/sway/commands/fullscreen.c @@ -23,7 +23,7 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) { // Wrap the workspace's children in a container so we can fullscreen it container = workspace_wrap_children(workspace); workspace->layout = L_HORIZ; - seat_set_focus(config->handler_context.seat, &container->node); + seat_set_focus_container(config->handler_context.seat, container); } bool enable = !container->is_fullscreen; -- cgit v1.2.3