git.lucas.co / cce-display-manager
login greeter
git clone https://git.lucas.co/cce-display-manager.git

commit1566b2e3ca0a23d2cc456186da24c099839d5c12
parentdab36d7061
authorLucas Galante <[email protected]>
date2026-05-28 21:10
fix: scale pointer event coordinates into layout space coordinates

 src/main.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 844c355..e017baf 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -944,8 +944,9 @@ impl PointerHandler for AppState {
         for event in events {
             let (x, y) = event.position;
             if let Some(state) = &mut self.state {
-                state.cursor_x = x as f32;
-                state.cursor_y = y as f32;
+                let ratio = state.compositor_scale / state.scale;
+                state.cursor_x = (x * ratio) as f32;
+                state.cursor_y = (y * ratio) as f32;
             }
 
             match &event.kind {