~kennylevinsen/wayllpaper

cc60f668b584e61591fb99dc101353f16c0e1fcc — Kenny Levinsen 5 months ago c98f05e master
Use XRGB and post damage
1 files changed, 5 insertions(+), 3 deletions(-)

M main.c
M main.c => main.c +5 -3
@@ 1,6 1,7 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <poll.h>
#include <stdbool.h>
#include <stdio.h>


@@ 51,6 52,7 @@ static void layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *su
		output->width = w;
		output->height = h;
		wl_surface_attach(output->wl_surface, ctx->buffer, 0, 0);
		wl_surface_damage(output->wl_surface, 0, 0, INT_MAX, INT_MAX);
		wp_viewport_set_destination(output->wp_viewport, output->width, output->height);
	}
	wl_surface_commit(output->wl_surface);


@@ 125,7 127,7 @@ static void registry_handle_global(void *data, struct wl_registry *registry, uin
		struct wl_shm_pool *pool =
			wl_shm_create_pool(shm, ctx->fd, ctx->width * ctx->height * 4);
		ctx->buffer = wl_shm_pool_create_buffer(pool, 0, ctx->width, ctx->height,
							ctx->width * 4, WL_SHM_FORMAT_ARGB8888);
							ctx->width * 4, WL_SHM_FORMAT_XRGB8888);
		wl_shm_pool_destroy(pool);
		wl_shm_destroy(shm);
	} else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {


@@ 179,13 181,13 @@ int main(int argc, char *argv[]) {
	};
	wl_list_init(&ctx.outputs);
	if (ctx.fd == -1) {
		fprintf(stderr, "could not open file: %d\n", errno);
		fprintf(stderr, "could not open file: %s\n", strerror(errno));
		return EXIT_FAILURE;
	}

	struct stat st;
	if (fstat(ctx.fd, &st) == -1) {
		fprintf(stderr, "could not stat file: %d\n", errno);
		fprintf(stderr, "could not stat file: %s\n", strerror(errno));
		return EXIT_FAILURE;
	} else if (st.st_size != ctx.width * ctx.height * 4) {
		fprintf(stderr, "dimensions do not match file size: %ld != %d\n", st.st_size,