aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <ddevault@linode.com>2015-11-18 09:55:55 -0500
committerDrew DeVault <ddevault@linode.com>2015-11-18 09:55:55 -0500
commit86372d00db86502cb41ae645b917c8191c22c994 (patch)
tree47a11db9d457d7f4f95dcf4531d1f8bac1994da0
parent665d4baaf170d2723f89a482298d1f972431b3c3 (diff)
Fix SIGBUS from wayland clients
-rw-r--r--include/client/client.h1
-rw-r--r--swaybg/main.c4
-rw-r--r--wayland/buffers.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/include/client/client.h b/include/client/client.h
index 39f18caf..5b24d315 100644
--- a/include/client/client.h
+++ b/include/client/client.h
@@ -15,7 +15,6 @@ struct output_state {
struct buffer {
struct wl_buffer *buffer;
- int fd;
cairo_surface_t *surface;
cairo_t *cairo;
PangoContext *pango;
diff --git a/swaybg/main.c b/swaybg/main.c
index 790eb66b..b4614ac0 100644
--- a/swaybg/main.c
+++ b/swaybg/main.c
@@ -21,7 +21,7 @@ int main(int argc, char **argv) {
state->width = output->width;
state->height = output->height;
- uint8_t r = 100, g = 100, b = 100;
+ uint8_t r = 0, g = 0, b = 0;
do {
if (client_prerender(state) && state->cairo) {
@@ -31,7 +31,7 @@ int main(int argc, char **argv) {
client_render(state);
- r++; if (r == 0) { g++; if (g == 0) { b++; } }
+ r++; g += 2; b += 4;
}
} while (wl_display_dispatch(state->display) != -1);
diff --git a/wayland/buffers.c b/wayland/buffers.c
index f426b912..6117e10b 100644
--- a/wayland/buffers.c
+++ b/wayland/buffers.c
@@ -66,6 +66,8 @@ static struct buffer *create_buffer(struct client_state *state, struct buffer *b
free(name);
fd = -1;
+ buf->width = width;
+ buf->height = height;
buf->surface = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, width, height, stride);
buf->cairo = cairo_create(buf->surface);
buf->pango = pango_cairo_create_context(buf->cairo);