Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit f85d8e7

Browse files
committed
Merge branch 'wlroots-next'
wlroots 0.15.0 was released
2 parents 09413da + 27f66c8 commit f85d8e7

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

dwl.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <libinput.h>
1414
#include <wayland-server-core.h>
1515
#include <wlr/backend.h>
16+
#include <wlr/render/allocator.h>
1617
#include <wlr/render/wlr_renderer.h>
1718
#include <wlr/types/wlr_compositor.h>
1819
#include <wlr/types/wlr_cursor.h>
@@ -307,6 +308,7 @@ static const char broken[] = "broken";
307308
static struct wl_display *dpy;
308309
static struct wlr_backend *backend;
309310
static struct wlr_renderer *drw;
311+
static struct wlr_allocator *alloc;
310312
static struct wlr_compositor *compositor;
311313

312314
static struct wlr_xdg_shell *xdg_shell;
@@ -551,7 +553,7 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
551553
box.y -= state->margin.bottom;
552554
}
553555
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);
555557
continue;
556558
}
557559
layersurface->geo = box;
@@ -775,7 +777,7 @@ commitnotify(struct wl_listener *listener, void *data)
775777
Client *c = wl_container_of(listener, c, commit);
776778

777779
/* 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)
779781
c->resize = 0;
780782
}
781783

@@ -818,6 +820,8 @@ createmon(struct wl_listener *listener, void *data)
818820
Monitor *m = wlr_output->data = calloc(1, sizeof(*m));
819821
m->wlr_output = wlr_output;
820822

823+
wlr_output_init_render(wlr_output, alloc, drw);
824+
821825
/* Initialize monitor state using configured rules */
822826
for (size_t i = 0; i < LENGTH(m->layers); i++)
823827
wl_list_init(&m->layers[i]);
@@ -926,13 +930,13 @@ createlayersurface(struct wl_listener *listener, void *data)
926930
wlr_layer_surface->data = layersurface;
927931

928932
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],
930934
&layersurface->link);
931935

932-
// Temporarily set the layer's current state to client_pending
936+
// Temporarily set the layer's current state to pending
933937
// so that we can easily arrange it
934938
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;
936940
arrangelayers(m);
937941
wlr_layer_surface->current = old_state;
938942
}
@@ -2002,12 +2006,15 @@ setup(void)
20022006
if (!(backend = wlr_backend_autocreate(dpy)))
20032007
BARF("couldn't create backend");
20042008

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");
20092012
wlr_renderer_init_wl_display(drw, dpy);
20102013

2014+
/* Create a default allocator */
2015+
if (!(alloc = wlr_allocator_autocreate(backend, drw)))
2016+
BARF("couldn't create allocator");
2017+
20112018
/* This creates some hands-off wlroots interfaces. The compositor is
20122019
* necessary for clients to allocate surfaces and the data device manager
20132020
* handles the clipboard. Each of these wlroots interfaces has room for you

0 commit comments

Comments
 (0)