|
13 | 13 | #include <libinput.h>
|
14 | 14 | #include <wayland-server-core.h>
|
15 | 15 | #include <wlr/backend.h>
|
| 16 | +#include <wlr/render/allocator.h> |
16 | 17 | #include <wlr/render/wlr_renderer.h>
|
17 | 18 | #include <wlr/types/wlr_compositor.h>
|
18 | 19 | #include <wlr/types/wlr_cursor.h>
|
@@ -307,6 +308,7 @@ static const char broken[] = "broken";
|
307 | 308 | static struct wl_display *dpy;
|
308 | 309 | static struct wlr_backend *backend;
|
309 | 310 | static struct wlr_renderer *drw;
|
| 311 | +static struct wlr_allocator *alloc; |
310 | 312 | static struct wlr_compositor *compositor;
|
311 | 313 |
|
312 | 314 | static struct wlr_xdg_shell *xdg_shell;
|
@@ -551,7 +553,7 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
|
551 | 553 | box.y -= state->margin.bottom;
|
552 | 554 | }
|
553 | 555 | if (box.width < 0 || box.height < 0) {
|
554 |
| - wlr_layer_surface_v1_close(wlr_layer_surface); |
| 556 | + wlr_layer_surface_v1_destroy(wlr_layer_surface); |
555 | 557 | continue;
|
556 | 558 | }
|
557 | 559 | layersurface->geo = box;
|
@@ -775,7 +777,7 @@ commitnotify(struct wl_listener *listener, void *data)
|
775 | 777 | Client *c = wl_container_of(listener, c, commit);
|
776 | 778 |
|
777 | 779 | /* mark a pending resize as completed */
|
778 |
| - if (c->resize && c->resize <= c->surface.xdg->configure_serial) |
| 780 | + if (c->resize && c->resize <= c->surface.xdg->current.configure_serial) |
779 | 781 | c->resize = 0;
|
780 | 782 | }
|
781 | 783 |
|
@@ -818,6 +820,8 @@ createmon(struct wl_listener *listener, void *data)
|
818 | 820 | Monitor *m = wlr_output->data = calloc(1, sizeof(*m));
|
819 | 821 | m->wlr_output = wlr_output;
|
820 | 822 |
|
| 823 | + wlr_output_init_render(wlr_output, alloc, drw); |
| 824 | + |
821 | 825 | /* Initialize monitor state using configured rules */
|
822 | 826 | for (size_t i = 0; i < LENGTH(m->layers); i++)
|
823 | 827 | wl_list_init(&m->layers[i]);
|
@@ -926,13 +930,13 @@ createlayersurface(struct wl_listener *listener, void *data)
|
926 | 930 | wlr_layer_surface->data = layersurface;
|
927 | 931 |
|
928 | 932 | m = wlr_layer_surface->output->data;
|
929 |
| - wl_list_insert(&m->layers[wlr_layer_surface->client_pending.layer], |
| 933 | + wl_list_insert(&m->layers[wlr_layer_surface->pending.layer], |
930 | 934 | &layersurface->link);
|
931 | 935 |
|
932 |
| - // Temporarily set the layer's current state to client_pending |
| 936 | + // Temporarily set the layer's current state to pending |
933 | 937 | // so that we can easily arrange it
|
934 | 938 | old_state = wlr_layer_surface->current;
|
935 |
| - wlr_layer_surface->current = wlr_layer_surface->client_pending; |
| 939 | + wlr_layer_surface->current = wlr_layer_surface->pending; |
936 | 940 | arrangelayers(m);
|
937 | 941 | wlr_layer_surface->current = old_state;
|
938 | 942 | }
|
@@ -2002,12 +2006,15 @@ setup(void)
|
2002 | 2006 | if (!(backend = wlr_backend_autocreate(dpy)))
|
2003 | 2007 | BARF("couldn't create backend");
|
2004 | 2008 |
|
2005 |
| - /* If we don't provide a renderer, autocreate makes a GLES2 renderer for us. |
2006 |
| - * The renderer is responsible for defining the various pixel formats it |
2007 |
| - * supports for shared memory, this configures that for clients. */ |
2008 |
| - drw = wlr_backend_get_renderer(backend); |
| 2009 | + /* Create a renderer with the default implementation */ |
| 2010 | + if (!(drw = wlr_renderer_autocreate(backend))) |
| 2011 | + BARF("couldn't create renderer"); |
2009 | 2012 | wlr_renderer_init_wl_display(drw, dpy);
|
2010 | 2013 |
|
| 2014 | + /* Create a default allocator */ |
| 2015 | + if (!(alloc = wlr_allocator_autocreate(backend, drw))) |
| 2016 | + BARF("couldn't create allocator"); |
| 2017 | + |
2011 | 2018 | /* This creates some hands-off wlroots interfaces. The compositor is
|
2012 | 2019 | * necessary for clients to allocate surfaces and the data device manager
|
2013 | 2020 | * handles the clipboard. Each of these wlroots interfaces has room for you
|
|
0 commit comments