mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
swaybg: remove assert crashing on hotplug
When hotplugging, an output may disappear and re-appear. This commit makes it so swaybg doesn't crash anymore in this case.
This commit is contained in:
parent
695948e689
commit
1ecc289543
1 changed files with 1 additions and 2 deletions
|
|
@ -194,8 +194,7 @@ static void xdg_output_handle_name(void *data,
|
||||||
struct zxdg_output_v1 *xdg_output, const char *name) {
|
struct zxdg_output_v1 *xdg_output, const char *name) {
|
||||||
struct swaybg_output *output = data;
|
struct swaybg_output *output = data;
|
||||||
struct swaybg_state *state = output->state;
|
struct swaybg_state *state = output->state;
|
||||||
if (strcmp(name, state->args->output) == 0) {
|
if (strcmp(name, state->args->output) == 0 && state->output == NULL) {
|
||||||
assert(state->output == NULL);
|
|
||||||
state->output = output;
|
state->output = output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue