summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-20 15:58:02 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-20 15:58:02 +0200
commitbebfe01d731a977c23c325dd37361f6d5f7268c2 (patch)
tree4fe2e39348eb3f95ae8c4f8e2dafdb110a0ae623 /src
parentfde68dd8cf19fb2c044c2f7f1dd6dec5cec8d642 (diff)
Added a custom NO_XWAYLAND flag
Diffstat (limited to 'src')
-rw-r--r--src/includes.hpp6
-rw-r--r--src/managers/KeybindManager.cpp6
-rw-r--r--src/managers/XWaylandManager.cpp20
-rw-r--r--src/managers/XWaylandManager.hpp2
4 files changed, 23 insertions, 11 deletions
diff --git a/src/includes.hpp b/src/includes.hpp
index 0b77cdb8..d0298c08 100644
--- a/src/includes.hpp
+++ b/src/includes.hpp
@@ -98,6 +98,12 @@ extern "C" {
#include <GLES3/gl3ext.h>
#endif
+#ifdef NO_XWAYLAND
+#define XWAYLAND false
+#else
+#define XWAYLAND true
+#endif
+
#include "helpers/Vector2D.hpp"
#include "../ext-workspace-unstable-v1-protocol.h" \ No newline at end of file
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 50d20524..f75e611c 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -89,7 +89,11 @@ bool CKeybindManager::handleInternalKeybinds(xkb_keysym_t keysym) {
// Dispatchers
void CKeybindManager::spawn(std::string args) {
- args = "WAYLAND_DISPLAY=" + std::string(g_pCompositor->m_szWLDisplaySocket) + " DISPLAY=" + std::string(g_pXWaylandManager->m_sWLRXWayland->display_name) + " " + args;
+ if (g_pXWaylandManager->m_sWLRXWayland)
+ args = "WAYLAND_DISPLAY=" + std::string(g_pCompositor->m_szWLDisplaySocket) + " DISPLAY=" + std::string(g_pXWaylandManager->m_sWLRXWayland->display_name) + " " + args;
+ else
+ args = "WAYLAND_DISPLAY=" + std::string(g_pCompositor->m_szWLDisplaySocket) + " " + args;
+
Debug::log(LOG, "Executing %s", args.c_str());
if (fork() == 0) {
execl("/bin/sh", "/bin/sh", "-c", args.c_str(), nullptr);
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 1c242a78..fcb72ef5 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -3,19 +3,21 @@
#include "../events/Events.hpp"
CHyprXWaylandManager::CHyprXWaylandManager() {
- m_sWLRXWayland = wlr_xwayland_create(g_pCompositor->m_sWLDisplay, g_pCompositor->m_sWLRCompositor, 1);
+ if (XWAYLAND) {
+ m_sWLRXWayland = wlr_xwayland_create(g_pCompositor->m_sWLDisplay, g_pCompositor->m_sWLRCompositor, 1);
- if (!m_sWLRXWayland) {
- Debug::log(ERR, "Couldn't start up the XWaylandManager because wlr_xwayland_create returned a nullptr!");
- return;
- }
+ if (!m_sWLRXWayland) {
+ Debug::log(ERR, "Couldn't start up the XWaylandManager because wlr_xwayland_create returned a nullptr!");
+ return;
+ }
- addWLSignal(&m_sWLRXWayland->events.ready, &Events::listen_readyXWayland, m_sWLRXWayland, "XWayland Manager");
- addWLSignal(&m_sWLRXWayland->events.new_surface, &Events::listen_surfaceXWayland, m_sWLRXWayland, "XWayland Manager");
+ addWLSignal(&m_sWLRXWayland->events.ready, &Events::listen_readyXWayland, m_sWLRXWayland, "XWayland Manager");
+ addWLSignal(&m_sWLRXWayland->events.new_surface, &Events::listen_surfaceXWayland, m_sWLRXWayland, "XWayland Manager");
- setenv("DISPLAY", m_sWLRXWayland->display_name, 1);
+ setenv("DISPLAY", m_sWLRXWayland->display_name, 1);
- Debug::log(LOG, "CHyprXWaylandManager started on display %s", m_sWLRXWayland->display_name);
+ Debug::log(LOG, "CHyprXWaylandManager started on display %s", m_sWLRXWayland->display_name);
+ }
}
CHyprXWaylandManager::~CHyprXWaylandManager() {
diff --git a/src/managers/XWaylandManager.hpp b/src/managers/XWaylandManager.hpp
index 7008d0e8..561865e4 100644
--- a/src/managers/XWaylandManager.hpp
+++ b/src/managers/XWaylandManager.hpp
@@ -8,7 +8,7 @@ public:
CHyprXWaylandManager();
~CHyprXWaylandManager();
- wlr_xwayland* m_sWLRXWayland;
+ wlr_xwayland* m_sWLRXWayland = nullptr;
wlr_surface* getWindowSurface(CWindow*);
void activateSurface(wlr_surface*, bool);