Merge branch 'wlroots-next' into scenegraph3

This commit is contained in:
Devin J. Pohly 2021-12-16 11:51:15 -06:00
commit 27514b9593

15
dwl.c
View file

@ -13,6 +13,7 @@
#include <libinput.h> #include <libinput.h>
#include <wayland-server-core.h> #include <wayland-server-core.h>
#include <wlr/backend.h> #include <wlr/backend.h>
#include <wlr/render/allocator.h>
#include <wlr/render/wlr_renderer.h> #include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_cursor.h> #include <wlr/types/wlr_cursor.h>
@ -304,6 +305,7 @@ static struct wlr_backend *backend;
static struct wlr_scene *scene; static struct wlr_scene *scene;
static struct wlr_scene_node *layers[NUM_LAYERS]; static struct wlr_scene_node *layers[NUM_LAYERS];
static struct wlr_renderer *drw; static struct wlr_renderer *drw;
static struct wlr_allocator *alloc;
static struct wlr_compositor *compositor; static struct wlr_compositor *compositor;
static struct wlr_xdg_shell *xdg_shell; static struct wlr_xdg_shell *xdg_shell;
@ -824,6 +826,8 @@ createmon(struct wl_listener *listener, void *data)
Monitor *m = wlr_output->data = calloc(1, sizeof(*m)); Monitor *m = wlr_output->data = calloc(1, sizeof(*m));
m->wlr_output = wlr_output; m->wlr_output = wlr_output;
wlr_output_init_render(wlr_output, alloc, drw);
/* Initialize monitor state using configured rules */ /* Initialize monitor state using configured rules */
for (size_t i = 0; i < LENGTH(m->layers); i++) for (size_t i = 0; i < LENGTH(m->layers); i++)
wl_list_init(&m->layers[i]); wl_list_init(&m->layers[i]);
@ -1844,12 +1848,15 @@ setup(void)
layers[LyrTop] = &wlr_scene_tree_create(&scene->node)->node; layers[LyrTop] = &wlr_scene_tree_create(&scene->node)->node;
layers[LyrOverlay] = &wlr_scene_tree_create(&scene->node)->node; layers[LyrOverlay] = &wlr_scene_tree_create(&scene->node)->node;
/* If we don't provide a renderer, autocreate makes a GLES2 renderer for us. /* Create a renderer with the default implementation */
* The renderer is responsible for defining the various pixel formats it if (!(drw = wlr_renderer_autocreate(backend)))
* supports for shared memory, this configures that for clients. */ BARF("couldn't create renderer");
drw = wlr_backend_get_renderer(backend);
wlr_renderer_init_wl_display(drw, dpy); wlr_renderer_init_wl_display(drw, dpy);
/* Create a default allocator */
if (!(alloc = wlr_allocator_autocreate(backend, drw)))
BARF("couldn't create allocator");
/* This creates some hands-off wlroots interfaces. The compositor is /* This creates some hands-off wlroots interfaces. The compositor is
* necessary for clients to allocate surfaces and the data device manager * necessary for clients to allocate surfaces and the data device manager
* handles the clipboard. Each of these wlroots interfaces has room for you * handles the clipboard. Each of these wlroots interfaces has room for you