In blitz-shell/src/window.rs, the WindowEvent::CursorMoved handler forwards the move to the DOM but — unlike every other event handler in the file — never calls self.request_redraw():
WindowEvent::CursorMoved { position, .. } => {
let LogicalPosition::<f32> { x, y } = position.to_logical(self.window.scale_factor());
self.mouse_pos = (x, y);
let event = UiEvent::MouseMove(BlitzMouseButtonEvent { x, y, /* … */ });
self.doc.handle_ui_event(event);
// no request_redraw() here
}
(observed in blitz-shell 0.2.3)
Impact
Any app that implements dragging purely in the DOM — onmousedown starts a drag, onmousemove updates a signal, the element re-renders at the new position — sees the dragged element trail behind the cursor. Because the move doesn't request a repaint, the new frame only shows up on the next event that does request one (mouse-up, wheel, etc.), so the element catches up only when you pause or release. Same effect for DOM-driven panning.
Expectation
A mouse-move that changes the DOM should repaint promptly, like in a browser.
Suggested fix
Keeps idle hover cheap by only repainting while a button is held (self.buttons is already in scope):
self.doc.handle_ui_event(event);
if !self.buttons.is_empty() {
self.request_redraw();
}
Alternatively, unconditionally request_redraw() on CursorMoved if the idle-hover cost is acceptable. Happy to open a PR.
In
blitz-shell/src/window.rs, theWindowEvent::CursorMovedhandler forwards the move to the DOM but — unlike every other event handler in the file — never callsself.request_redraw():(observed in
blitz-shell0.2.3)Impact
Any app that implements dragging purely in the DOM —
onmousedownstarts a drag,onmousemoveupdates a signal, the element re-renders at the new position — sees the dragged element trail behind the cursor. Because the move doesn't request a repaint, the new frame only shows up on the next event that does request one (mouse-up, wheel, etc.), so the element catches up only when you pause or release. Same effect for DOM-driven panning.Expectation
A mouse-move that changes the DOM should repaint promptly, like in a browser.
Suggested fix
Keeps idle hover cheap by only repainting while a button is held (
self.buttonsis already in scope):Alternatively, unconditionally
request_redraw()onCursorMovedif the idle-hover cost is acceptable. Happy to open a PR.