summaryrefslogtreecommitdiff
path: root/sway/commands/blur_xray.c
blob: 045566d0671b5383373298a1dde684ca9bdbe757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "sway/commands.h"
#include "sway/config.h"
#include "sway/output.h"
#include "util.h"

struct cmd_results *cmd_blur_xray(int argc, char **argv) {
	struct cmd_results *error = checkarg(argc, "blur_xray", EXPECTED_AT_LEAST, 1);

	if (error) {
		return error;
	}

	bool result = parse_boolean(argv[0], config->blur_xray);
	config->blur_xray = result;

	struct sway_output *output;
	wl_list_for_each(output, &root->all_outputs, link) {
		if (output->renderer) {
			output->renderer->blur_buffer_dirty = true;
			output_damage_whole(output);
		}
	}

	return cmd_results_new(CMD_SUCCESS, NULL);
}