Properly skip events
So the mouse doesn’t get trapped because the button release event is swallowed up.
This commit is contained in:
parent
71fb001d25
commit
fea5ca3520
2 changed files with 8 additions and 2 deletions
|
@ -1049,7 +1049,10 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event)
|
|||
// very expensive, and aegisub’s work queue handling is bad,
|
||||
// so limit mouse event rate to ~200 Hz
|
||||
long ts = event.GetTimestamp();
|
||||
if ((ts - last_event) < 5) return;
|
||||
if (!event.IsButton() && (ts - last_event) < 5) {
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
last_event = ts;
|
||||
|
||||
// If we have focus, we get mouse move events on Mac even when the mouse is
|
||||
|
|
|
@ -176,7 +176,10 @@ void VisualTool<FeatureType>::OnMouseEvent(wxMouseEvent &event) {
|
|||
// 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;
|
||||
if (!event.IsButton() && (ts - lastEvent) < 5) {
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
lastEvent = ts;
|
||||
|
||||
bool left_click = event.LeftDown();
|
||||
|
|
Loading…
Reference in a new issue