Fork of https://github.com/lelgenio/wl-crosshair - A crosshair overlay for wlroots compositor

Fix crosshair positioning on COSMIC

belsanti.xyz 997f9bb4 940acb43

verified
Changed files
+4 -4
src
+4 -4
src/main.rs
···
use wayland_protocols_wlr::layer_shell::v1::client::{
zwlr_layer_shell_v1::{self, Layer},
-
zwlr_layer_surface_v1::{self, Anchor},
+
zwlr_layer_surface_v1::{self, KeyboardInteractivity},
};
use wayland_protocols::xdg::shell::client::xdg_wm_base;
···
qh,
(),
);
-
// Center the window
-
layer.set_anchor(Anchor::Top | Anchor::Right | Anchor::Bottom | Anchor::Left);
-
layer.set_keyboard_interactivity(zwlr_layer_surface_v1::KeyboardInteractivity::None);
+
// Center the window - remove anchors to allow free positioning
+
// layer.set_anchor(Anchor::empty()); // No anchors for centering
+
layer.set_keyboard_interactivity(KeyboardInteractivity::None);
layer.set_size(self.cursor_width, self.cursor_height);
// A negative value means we will be centered on the screen
// independently of any other xdg_layer_shell