Skip to content

wxMathPlot confused by spurious wxEVT_LEFT_UP event #80

@DRNadler

Description

@DRNadler

Background
WxWidgets (many versions including to latest as of 15-July-2025) has a bug that sometimes generates a spurious wxEVT_LEFT_UP event after a double-click. When you have a dialog that is completed by a double-click (ie, you double-click on a filename in a wxFileDialog, or you double-click on a list entry in your own dialog), the dialog closes just fine after completing the double-click processing. Unfortunately, the spurious wxEVT_LEFT_UP event is sent to what-ever window was in back of the double-click position. The foreground dialog is already gone when the event shows up for wxWidgets - so wxWidgets just routes it to the top-most window at the click position...

See for example:
Dave's summary wxWidgets Issue
wxWidgets/issues/25446
wxWidgets/issues/10924
Incomplete fix attempt

wxMathPlot Problem
The spurious wxEVT_LEFT_UP causes bad ZoomRect to strange size in mpWindow::OnMouseLeftRelease(wxMouseEvent &event)
It looks like wxMathPlot has lost its mind when this happens.

So, what is a sensible way to handle this in wxMathPlot?
It's unfortunate that this is not fixed inside wxWidgets event processing, aarrrgggg....
Basically a left-up event should only be allowed after a left-down (and not after a left-down and mouse-leaves-window, etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions