--- a/plugins/cube/cube.cpp +++ b/plugins/cube/cube.cpp @@ -1602,37 +1602,27 @@ double xdiff = ev->delta_x; double ydiff = ev->delta_y * -1.0; + // Direct manipulation follows every pointer delta immediately. The + // shared animation clock belongs to entry, exit and keyboard turns; + // restarting it here makes drag response depend on its easing curve. const double current_off_y = animation.cube_animation.offset_y; - const double target_off_y = mouse_overview_active ? - animation.cube_animation.offset_y.end : current_off_y; - const double off_y = wf::clamp(target_off_y + ydiff * YVelocity, -1.5, 1.5); - if (mouse_overview_active && (xdiff == 0) && - (off_y == animation.cube_animation.offset_y.end)) - { - // Motion beyond either tilt limit leaves a settled stack asleep. - return; - } - - animation.cube_animation.zoom.restart_with_end( - animation.cube_animation.zoom.end); - - if (mouse_overview_active) - { - overview_mix.restart_with_end(1); - } - animation.cube_animation.offset_y.set(current_off_y, off_y); - animation.cube_animation.offset_z.restart_with_end( - animation.cube_animation.offset_z.end); - - float current_rotation = mouse_overview_active ? animation.cube_animation.rotation.end : - float(animation.cube_animation.rotation); - animation.cube_animation.rotation.restart_with_end( - current_rotation + xdiff * XVelocity); - - animation.cube_animation.ease_deformation.restart_with_end( - animation.cube_animation.ease_deformation.end); - - start_animation(); + const double off_y = wf::clamp(current_off_y + ydiff * YVelocity, -1.5, 1.5); + if ((xdiff == 0) && (off_y == current_off_y)) + { + // Motion beyond either tilt limit leaves a settled cube asleep. + return; + } + + const double rotation = double(animation.cube_animation.rotation) + xdiff * XVelocity; + animation.cube_animation.rotation.set(rotation, rotation); + animation.cube_animation.offset_y.set(off_y, off_y); + update_view_matrix(); + if (render_node) + { + // Pose changes still need damage after the entry animation has + // settled; scheduling a frame alone does not repaint the cube. + wf::scene::damage_node(render_node, render_node->get_bounding_box()); + } output->render->schedule_redraw(); }