This change avoids rendering new buffers unless required.
The mechanism of storing the last committed width/height/scale ensures that swaybg will avoid redrawing the output buffer if it can do so; this works even for the case where the output scale changes, but the buffer size (scale * configured size) does not.
This also avoids redrawing the background when the compositor resends the zwlr_layer_surface_v1::configure event with the same recommended size as before; recent Sway tends to do this whenever a new layer shell surface is added.
This change avoids rendering new buffers unless required.
The mechanism of storing the last committed width/height/scale ensures that swaybg will avoid redrawing the output buffer if it can do so; this works even for the case where the output scale changes, but the buffer size (scale * configured size) does not.
This also avoids redrawing the background when the compositor resends the zwlr_layer_surface_v1::configure event with the same recommended size as before; recent Sway tends to do this whenever a new layer shell surface is added.