diff --git a/src/visual_tool.cpp b/src/visual_tool.cpp index 24d1f40bb..e27a3c2b1 100644 --- a/src/visual_tool.cpp +++ b/src/visual_tool.cpp @@ -170,6 +170,13 @@ VisualTool::VisualTool(VideoDisplay *parent, agi::Context *context) template void VisualTool::OnMouseEvent(wxMouseEvent &event) { + // wx doesn’t throttle for us, updating the video view is + // very expensive, and aegisub’s work queue handling is bad, + // so limit mouse event rate to ~200 Hz + long ts = event.GetTimestamp(); + if ((ts - lastEvent) < 5) return; + lastEvent = ts; + bool left_click = event.LeftDown(); bool left_double = event.LeftDClick(); shift_down = event.ShiftDown(); diff --git a/src/visual_tool.h b/src/visual_tool.h index 5e62920ae..00b4da1c8 100644 --- a/src/visual_tool.h +++ b/src/visual_tool.h @@ -92,6 +92,7 @@ protected: bool holding = false; ///< Is a hold currently in progress? AssDialogue *active_line = nullptr; ///< Active dialogue line; nullptr if it is not visible on the current frame bool dragging = false; ///< Is a drag currently in progress? + long lastEvent = 0; int frame_number; ///< Current frame number