summaryrefslogtreecommitdiff
path: root/sway/commands/dim_inactive.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/dim_inactive.c')
-rw-r--r--sway/commands/dim_inactive.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sway/commands/dim_inactive.c b/sway/commands/dim_inactive.c
index c7c03caa..e287ba4d 100644
--- a/sway/commands/dim_inactive.c
+++ b/sway/commands/dim_inactive.c
@@ -3,6 +3,7 @@
#include "sway/config.h"
#include "log.h"
#include "sway/output.h"
+#include "sway/tree/container.h"
struct cmd_results *cmd_dim_inactive(int argc, char **argv) {
struct cmd_results *error = NULL;
@@ -16,14 +17,11 @@ struct cmd_results *cmd_dim_inactive(int argc, char **argv) {
return cmd_results_new(CMD_INVALID, "dim_inactive float invalid");
}
- config->dim_inactive = val;
-
- if (config->active) {
- for (int i = 0; i < root->outputs->length; ++i) {
- struct sway_output *output = root->outputs->items[i];
- output_damage_whole(output);
- }
- }
+ struct sway_container *container = config->handler_context.container;
+ if (!container) {
+ return cmd_results_new(CMD_INVALID, "cmd_dim cannot be used without a for_window rule");
+ }
+ container->dim = val;
return cmd_results_new(CMD_SUCCESS, NULL);
}