summaryrefslogtreecommitdiff
path: root/src/xwayland/XWayland.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-05-25 22:43:51 +0200
committerGitHub <noreply@github.com>2024-05-25 22:43:51 +0200
commitaddd3e7f1aeb670dd91d26005aaeccce3efb1ae7 (patch)
tree7eae3cf1d780ab84ff34ee0fce5ed85d9ee69c90 /src/xwayland/XWayland.cpp
parenta71207434c0bc2c8e05e94b1619e68059a002879 (diff)
xwayland: move to hyprland impl (#6086)
Diffstat (limited to 'src/xwayland/XWayland.cpp')
-rw-r--r--src/xwayland/XWayland.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/xwayland/XWayland.cpp b/src/xwayland/XWayland.cpp
new file mode 100644
index 00000000..8d45fa63
--- /dev/null
+++ b/src/xwayland/XWayland.cpp
@@ -0,0 +1,28 @@
+#include "XWayland.hpp"
+#include "../debug/Log.hpp"
+
+CXWayland::CXWayland() {
+#ifndef NO_XWAYLAND
+ Debug::log(LOG, "Starting up the XWayland server");
+
+ pServer = std::make_unique<CXWaylandServer>();
+
+ if (!pServer->create()) {
+ Debug::log(ERR, "XWayland failed to start: it will not work.");
+ return;
+ }
+#else
+ Debug::log(LOG, "Not starting XWayland: disabled at compile time");
+#endif
+}
+
+void CXWayland::setCursor(unsigned char* pixData, uint32_t stride, const Vector2D& size, const Vector2D& hotspot) {
+#ifndef NO_XWAYLAND
+ if (!pWM) {
+ Debug::log(ERR, "Couldn't set XCursor: no XWM yet");
+ return;
+ }
+
+ pWM->setCursor(pixData, stride, size, hotspot);
+#endif
+} \ No newline at end of file