mirror of
https://github.com/swaywm/sway.git
synced 2024-12-28 07:56:31 +01:00
Fix SIGBUS from wayland clients
This commit is contained in:
parent
665d4baaf1
commit
86372d00db
3 changed files with 4 additions and 3 deletions
|
@ -15,7 +15,6 @@ struct output_state {
|
|||
|
||||
struct buffer {
|
||||
struct wl_buffer *buffer;
|
||||
int fd;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cairo;
|
||||
PangoContext *pango;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue