diff --git a/src/config/session.c b/src/config/session.c index 3ba7913b..7df6236c 100644 --- a/src/config/session.c +++ b/src/config/session.c @@ -8,8 +8,8 @@ #include #include #include -#include #include +#include #include #include "common/buf.h" #include "common/dir.h" @@ -20,6 +20,12 @@ #include "config/rcxml.h" #include "labwc.h" +#if WLR_HAS_DRM_BACKEND + #include +#else + #define wlr_backend_is_drm(backend) (false) +#endif + static const char *const env_vars[] = { "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP", diff --git a/src/output.c b/src/output.c index f4f1da01..b04fe2d7 100644 --- a/src/output.c +++ b/src/output.c @@ -10,11 +10,10 @@ #include "output.h" #include #include -#include +#include #include #include #include -#include #include #include #include @@ -39,7 +38,14 @@ #include "xwayland.h" #if WLR_HAS_X11_BACKEND -#include + #include +#endif + +#if WLR_HAS_DRM_BACKEND + #include + #include +#else + #define wlr_output_is_drm(output) (false) #endif bool @@ -452,14 +458,8 @@ handle_new_output(struct wl_listener *listener, void *data) * This is also useful for debugging the DRM parts of * another compositor. * - * All drm leasing is disabled due to a UAF bug in wlroots. - * We assume that the fix will be backported to 0.19.1 and thus - * check for a version >= 0.19.1. See following link for the fix status: - * https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5104 - * - * TODO: remove once labwc starts tracking 0.20.x and the fix has been merged. */ -#if LAB_WLR_VERSION_AT_LEAST(0, 19, 1) +#if WLR_HAS_DRM_BACKEND if (server.drm_lease_manager && wlr_output_is_drm(wlr_output)) { wlr_drm_lease_v1_manager_offer_output( server.drm_lease_manager, wlr_output); diff --git a/src/server.c b/src/server.c index 6fd0c8e4..fd48efed 100644 --- a/src/server.c +++ b/src/server.c @@ -6,12 +6,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -41,7 +41,11 @@ #include #if HAVE_XWAYLAND -#include + #include +#endif + +#if WLR_HAS_DRM_BACKEND + #include #endif #include "action.h" @@ -192,6 +196,7 @@ handle_sigchld(int signal, void *data) return 0; } +#if WLR_HAS_DRM_BACKEND static void handle_drm_lease_request(struct wl_listener *listener, void *data) { @@ -203,6 +208,7 @@ handle_drm_lease_request(struct wl_listener *listener, void *data) return; } } +#endif static bool protocol_is_privileged(const struct wl_interface *iface) @@ -692,6 +698,7 @@ server_init(void) session_lock_init(); +#if WLR_HAS_DRM_BACKEND server.drm_lease_manager = wlr_drm_lease_v1_manager_create( server.wl_display, server.backend); if (server.drm_lease_manager) { @@ -702,6 +709,7 @@ server_init(void) wlr_log(WLR_DEBUG, "Failed to create wlr_drm_lease_device_v1"); wlr_log(WLR_INFO, "VR will not be available"); } +#endif server.output_power_manager_v1 = wlr_output_power_manager_v1_create(server.wl_display);