2024-04-15 15:39:41 +10:00
|
|
|
#include "scenefx/render/fx_renderer/fx_effect_framebuffers.h"
|
2023-04-18 07:24:48 +10:00
|
|
|
#include "sway/commands.h"
|
|
|
|
#include "sway/config.h"
|
|
|
|
#include "sway/output.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
struct cmd_results *cmd_blur(int argc, char **argv) {
|
|
|
|
struct cmd_results *error = checkarg(argc, "blur", EXPECTED_AT_LEAST, 1);
|
|
|
|
|
|
|
|
if (error) {
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct sway_container *con = config->handler_context.container;
|
|
|
|
|
2023-05-20 05:14:06 +10:00
|
|
|
bool result = parse_boolean(argv[0], true);
|
2023-04-18 07:24:48 +10:00
|
|
|
if (con == NULL) {
|
|
|
|
config->blur_enabled = result;
|
|
|
|
} else {
|
|
|
|
con->blur_enabled = result;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct sway_output *output;
|
|
|
|
wl_list_for_each(output, &root->all_outputs, link) {
|
2024-04-15 15:39:41 +10:00
|
|
|
struct fx_effect_framebuffers *effect_fbos =
|
|
|
|
fx_effect_framebuffers_try_get(output->wlr_output);
|
|
|
|
effect_fbos->blur_buffer_dirty = true;
|
|
|
|
output_damage_whole(output);
|
2023-04-18 07:24:48 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
|
|
|
}
|