From addd3e7f1aeb670dd91d26005aaeccce3efb1ae7 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 25 May 2024 22:43:51 +0200 Subject: xwayland: move to hyprland impl (#6086) --- src/xwayland/Server.hpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/xwayland/Server.hpp (limited to 'src/xwayland/Server.hpp') diff --git a/src/xwayland/Server.hpp b/src/xwayland/Server.hpp new file mode 100644 index 00000000..0c06a56c --- /dev/null +++ b/src/xwayland/Server.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include +#include "../helpers/signal/Signal.hpp" + +struct wl_event_source; +struct wl_client; + +// TODO: add lazy mode +class CXWaylandServer { + public: + CXWaylandServer(); + ~CXWaylandServer(); + + // create the server. + bool create(); + + // starts the server, meant to be called by CXWaylandServer. + bool start(); + + // called on ready + int ready(int fd, uint32_t mask); + + void die(); + + struct { + CSignal ready; + } events; + + wl_client* xwaylandClient = nullptr; + + private: + bool tryOpenSockets(); + void runXWayland(int notifyFD); + + pid_t serverPID = 0; + + std::string displayName; + int display = -1; + std::array xFDs = {-1, -1}; + std::array xFDReadEvents = {nullptr, nullptr}; + wl_event_source* idleSource = nullptr; + wl_event_source* pipeSource = nullptr; + std::array xwmFDs = {-1, -1}; + std::array waylandFDs = {-1, -1}; + + friend class CXWM; +}; -- cgit v1.2.3