2018-05-15 05:14:18 +02:00
|
|
|
#define _POSIX_C_SOURCE 200809L
|
|
|
|
#include <string.h>
|
|
|
|
#include "sway/commands.h"
|
|
|
|
#include "sway/config.h"
|
2018-08-26 04:05:16 +02:00
|
|
|
#include "sway/tree/root.h"
|
2018-05-15 05:14:18 +02:00
|
|
|
#include "sway/tree/view.h"
|
|
|
|
#include "sway/output.h"
|
|
|
|
#include "list.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "stringop.h"
|
2018-07-23 21:04:46 +02:00
|
|
|
#include "util.h"
|
2018-05-15 05:14:18 +02:00
|
|
|
|
|
|
|
static void rebuild_marks_iterator(struct sway_container *con, void *data) {
|
|
|
|
if (con->type == C_VIEW) {
|
|
|
|
view_update_marks_textures(con->sway_view);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct cmd_results *cmd_show_marks(int argc, char **argv) {
|
|
|
|
struct cmd_results *error = NULL;
|
|
|
|
if ((error = checkarg(argc, "show_marks", EXPECTED_AT_LEAST, 1))) {
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2018-07-23 21:04:46 +02:00
|
|
|
config->show_marks = parse_boolean(argv[0], config->show_marks);
|
2018-05-15 05:14:18 +02:00
|
|
|
|
|
|
|
if (config->show_marks) {
|
2018-08-17 11:48:34 +02:00
|
|
|
root_for_each_container(rebuild_marks_iterator, NULL);
|
2018-05-15 05:14:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < root_container.children->length; ++i) {
|
|
|
|
struct sway_container *con = root_container.children->items[i];
|
|
|
|
output_damage_whole(con->sway_output);
|
|
|
|
}
|
|
|
|
|
|
|
|
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
|
|
|
}
|