From ff9bcb19fa1944635d6064710f7b947bd53aa42c Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 29 Jan 2023 12:43:18 +0000 Subject: [PATCH] Allow to disable X11 backend separately from Xwayland after 5a750b485aca (#1445) --- src/helpers/X11Stubs.hpp | 7 +++++++ src/helpers/XWaylandStubs.hpp | 6 ------ src/includes.hpp | 9 ++++++++- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 src/helpers/X11Stubs.hpp diff --git a/src/helpers/X11Stubs.hpp b/src/helpers/X11Stubs.hpp new file mode 100644 index 000000000..19bea6f8d --- /dev/null +++ b/src/helpers/X11Stubs.hpp @@ -0,0 +1,7 @@ +#pragma once + +inline bool wlr_backend_is_x11(void*) { + return false; +} + +inline void wlr_x11_output_create(void*) {} diff --git a/src/helpers/XWaylandStubs.hpp b/src/helpers/XWaylandStubs.hpp index 080aa8072..af8080746 100644 --- a/src/helpers/XWaylandStubs.hpp +++ b/src/helpers/XWaylandStubs.hpp @@ -160,9 +160,3 @@ inline void wlr_xwayland_surface_close(wlr_xwayland_surface*) {} inline void wlr_xwayland_surface_set_fullscreen(wlr_xwayland_surface*, bool) {} inline void wlr_xwayland_surface_set_minimized(wlr_xwayland_surface*, bool) {} - -inline bool wlr_backend_is_x11(void*) { - return false; -} - -inline void wlr_x11_output_create(void*) {} \ No newline at end of file diff --git a/src/includes.hpp b/src/includes.hpp index 29737fbbb..8c804ceba 100644 --- a/src/includes.hpp +++ b/src/includes.hpp @@ -105,8 +105,11 @@ extern "C" { #include -#ifndef NO_XWAYLAND +#if WLR_HAS_X11_BACKEND #include +#endif + +#ifndef NO_XWAYLAND #include #endif } @@ -127,6 +130,10 @@ extern "C" { #include #endif +#if !WLR_HAS_X11_BACKEND +#include "helpers/X11Stubs.hpp" +#endif + #ifdef NO_XWAYLAND #define XWAYLAND false #include "helpers/XWaylandStubs.hpp"