aboutsummaryrefslogtreecommitdiff
path: root/include/CursorTracker/CursorTrackerWayland.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-05-03 12:03:43 +0200
committerdec05eba <dec05eba@protonmail.com>2025-05-03 12:03:43 +0200
commitd08ea692771caa8e385412c2f992089672773e30 (patch)
tree994c05673d90b130e25d8bc25c6c365f607134db /include/CursorTracker/CursorTrackerWayland.hpp
parent180a3b73dbab2f586c53f9e5f044ab88aca95014 (diff)
Keep keyboard led when turning on global hotkeys, move files
Diffstat (limited to 'include/CursorTracker/CursorTrackerWayland.hpp')
-rw-r--r--include/CursorTracker/CursorTrackerWayland.hpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/CursorTracker/CursorTrackerWayland.hpp b/include/CursorTracker/CursorTrackerWayland.hpp
new file mode 100644
index 0000000..1eeee83
--- /dev/null
+++ b/include/CursorTracker/CursorTrackerWayland.hpp
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "CursorTracker.hpp"
+#include <stdint.h>
+#include <vector>
+
+struct wl_display;
+struct wl_registry;
+struct wl_output;
+struct zxdg_output_manager_v1;
+struct zxdg_output_v1;
+
+namespace gsr {
+ struct WaylandOutput {
+ uint32_t wl_name;
+ struct wl_output *output;
+ struct zxdg_output_v1 *xdg_output;
+ mgl::vec2i pos;
+ mgl::vec2i size;
+ int32_t transform;
+ std::string name;
+ };
+
+ class CursorTrackerWayland : public CursorTracker {
+ public:
+ CursorTrackerWayland(const char *card_path);
+ CursorTrackerWayland(const CursorTrackerWayland&) = delete;
+ CursorTrackerWayland& operator=(const CursorTrackerWayland&) = delete;
+ ~CursorTrackerWayland();
+
+ void update() override;
+ std::optional<CursorInfo> get_latest_cursor_info() override;
+
+ std::vector<WaylandOutput> monitors;
+ struct zxdg_output_manager_v1 *xdg_output_manager = nullptr;
+ private:
+ void set_monitor_outputs_from_xdg_output(struct wl_display *dpy);
+ private:
+ int drm_fd = -1;
+ mgl::vec2i latest_cursor_position; // Position of the cursor within the monitor
+ int latest_crtc_id = -1;
+ };
+} \ No newline at end of file