mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
parent
118a62cb56
commit
a26026f708
2 changed files with 23 additions and 2 deletions
|
|
@ -209,6 +209,7 @@ struct server {
|
|||
char pending_output_name[4096];
|
||||
} headless;
|
||||
struct wlr_session *session;
|
||||
struct wlr_linux_dmabuf_v1 *linux_dmabuf;
|
||||
|
||||
struct wlr_xdg_shell *xdg_shell;
|
||||
struct wlr_layer_shell_v1 *layer_shell;
|
||||
|
|
|
|||
24
src/server.c
24
src/server.c
|
|
@ -6,6 +6,7 @@
|
|||
#include <wlr/backend/headless.h>
|
||||
#include <wlr/backend/multi.h>
|
||||
#include <wlr/types/wlr_data_control_v1.h>
|
||||
#include <wlr/types/wlr_drm.h>
|
||||
#include <wlr/types/wlr_export_dmabuf_v1.h>
|
||||
#include <wlr/types/wlr_fractional_scale_v1.h>
|
||||
#include <wlr/types/wlr_gamma_control_v1.h>
|
||||
|
|
@ -35,6 +36,7 @@
|
|||
|
||||
#define LAB_WLR_COMPOSITOR_VERSION 5
|
||||
#define LAB_WLR_FRACTIONAL_SCALE_V1_VERSION 1
|
||||
#define LAB_WLR_LINUX_DMABUF_VERSION 4
|
||||
|
||||
static struct wlr_compositor *compositor;
|
||||
static struct wl_event_source *sighup_source;
|
||||
|
|
@ -285,7 +287,22 @@ server_init(struct server *server)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
wlr_renderer_init_wl_display(server->renderer, server->wl_display);
|
||||
if (!wlr_renderer_init_wl_shm(server->renderer, server->wl_display)) {
|
||||
wlr_log(WLR_ERROR, "Failed to initialize shared memory pool");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (wlr_renderer_get_dmabuf_texture_formats(server->renderer)) {
|
||||
if (wlr_renderer_get_drm_fd(server->renderer) >= 0) {
|
||||
wlr_log(WLR_ERROR, "initializing wlr_drm");
|
||||
wlr_drm_create(server->wl_display, server->renderer);
|
||||
}
|
||||
wlr_log(WLR_ERROR, "initializing dmabuf");
|
||||
server->linux_dmabuf = wlr_linux_dmabuf_v1_create_with_renderer(
|
||||
server->wl_display, LAB_WLR_LINUX_DMABUF_VERSION, server->renderer);
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "NOT initializing dmabuf");
|
||||
}
|
||||
|
||||
/*
|
||||
* Autocreates an allocator for us. The allocator is the bridge between
|
||||
|
|
@ -390,7 +407,10 @@ server_init(struct server *server)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
wlr_scene_set_presentation(server->scene, presentation);
|
||||
|
||||
if (server->linux_dmabuf) {
|
||||
wlr_log(WLR_ERROR, "initializing scene dmabuf");
|
||||
wlr_scene_set_linux_dmabuf_v1(server->scene, server->linux_dmabuf);
|
||||
}
|
||||
wlr_export_dmabuf_manager_v1_create(server->wl_display);
|
||||
wlr_screencopy_manager_v1_create(server->wl_display);
|
||||
wlr_data_control_manager_v1_create(server->wl_display);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue