Create WAYLAND_DISPLAY socket
This commit is contained in:
parent
b93f00b92f
commit
8ce9237c92
|
@ -1,4 +1,4 @@
|
||||||
#define _POSIX_C_SOURCE 199309L
|
#define _POSIX_C_SOURCE 200112L
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -460,6 +460,9 @@ void compositor_init(struct compositor_state *state) {
|
||||||
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &state->last_frame);
|
clock_gettime(CLOCK_MONOTONIC, &state->last_frame);
|
||||||
|
|
||||||
|
const char *socket = wl_display_add_socket_auto(state->display);
|
||||||
|
wlr_log(L_INFO, "Running compositor on wayland display '%s'", socket);
|
||||||
|
setenv("_WAYLAND_DISPLAY", socket, true);
|
||||||
if (!wlr_backend_init(state->backend)) {
|
if (!wlr_backend_init(state->backend)) {
|
||||||
wlr_log(L_ERROR, "Failed to initialize backend");
|
wlr_log(L_ERROR, "Failed to initialize backend");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _EXAMPLE_SHARED_H
|
#ifndef _EXAMPLE_SHARED_H
|
||||||
#define _EXAMPLE_SHARED_H
|
#define _EXAMPLE_SHARED_H
|
||||||
#define _POSIX_C_SOURCE 199309L
|
#ifndef _POSIX_C_SOURCE
|
||||||
|
#define _POSIX_C_SOURCE 200112L
|
||||||
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
|
|
Loading…
Reference in New Issue