git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commitb11ad7c711f90d281be16d93fe9ccf14a1edc7c1
parent7c65e048cc
authorLucas Galante <[email protected]>
date2026-07-03 18:09
fix: sync modifier key states in update_modifiers and mouse_wheel events

 src/backend/window_runner.rs | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/backend/window_runner.rs b/src/backend/window_runner.rs
index 8fb9ccd..7e92374 100644
--- a/src/backend/window_runner.rs
+++ b/src/backend/window_runner.rs
@@ -2245,6 +2245,12 @@ impl<A: Application> PointerHandler for EngineState<A> {
                 MouseScrollDelta::LineDelta(-h_lines, -v_lines)
             };
             let mut rebuild = false;
+            if let Some(ctx) = self.inner.ui_context_mut() {
+                ctx.ctrl_pressed = self.ctrl_pressed;
+                ctx.shift_pressed = self.shift_pressed;
+                ctx.alt_pressed = self.alt_pressed;
+                ctx.logo_pressed = self.logo_pressed;
+            }
             self.inner.handle_mouse_wheel(&delta, LogicalPosition::new(last_lx, last_ly), &mut rebuild);
             if rebuild {
                 self.redraw = true;
@@ -2313,6 +2319,13 @@ impl<A: Application> KeyboardHandler for EngineState<A> {
         self.shift_pressed = modifiers.shift;
         self.alt_pressed = modifiers.alt;
         self.logo_pressed = modifiers.logo;
+
+        if let Some(ctx) = self.inner.ui_context_mut() {
+            ctx.ctrl_pressed = self.ctrl_pressed;
+            ctx.shift_pressed = self.shift_pressed;
+            ctx.alt_pressed = self.alt_pressed;
+            ctx.logo_pressed = self.logo_pressed;
+        }
     }
 
     fn update_repeat_info(