Skip to content

Commit

Permalink
commands/opacity: Call output_configure_scene on updated container
Browse files Browse the repository at this point in the history
Calling container_update() wasn't enough: If there is no visible window
decorations (title bar, borders) container_update would basically no-op
and the scene wouldn't repaint with the update alpha. By also calling
output_configure_scene() we force a call to
wlr_scene_buffer_set_opacity() thus ensuring we update the scene.

Closes: swaywm#8580
  • Loading branch information
Nefsen402 committed Feb 18, 2025
1 parent f0bab83 commit d1f2b62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sway/commands/opacity.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include <stdlib.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/tree/view.h"
#include "sway/tree/container.h"
#include "sway/output.h"
#include "log.h"

struct cmd_results *cmd_opacity(int argc, char **argv) {
Expand Down Expand Up @@ -37,6 +38,7 @@ struct cmd_results *cmd_opacity(int argc, char **argv) {
}

con->alpha = val;
output_configure_scene(NULL, &con->scene_tree->node, 1);
container_update(con);

return cmd_results_new(CMD_SUCCESS, NULL);
Expand Down

0 comments on commit d1f2b62

Please sign in to comment.