swayfx/sway/commands/reload.c
Ryan Dwyer bb66e6d578 Refactor everything that needs to arrange windows
* The arrange_foo functions are now replaced with arrange_and_commit, or
with manually created transactions and arrange_windows x2.
* The arrange functions are now only called from the highest level
functions rather than from both high level and low level functions.
* Due to the previous point, view_set_fullscreen_raw and
view_set_fullscreen are both merged into one function again.
* Floating and fullscreen are now working with transactions.
2018-06-09 10:11:25 +10:00

18 lines
506 B
C

#include "sway/commands.h"
#include "sway/config.h"
#include "sway/tree/arrange.h"
struct cmd_results *cmd_reload(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "reload", EXPECTED_EQUAL_TO, 0))) {
return error;
}
if (!load_main_config(config->current_config, true)) {
return cmd_results_new(CMD_FAILURE, "reload", "Error(s) reloading config.");
}
load_swaybars();
arrange_and_commit(&root_container);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}