Refactor mouse event handling in wisteria to remove fragile math

Mouse support in wisteria currently uses some fragile, hard-coded assumptions about the sizes and positions of UI elements in order to correctly calculate the message that a click event actually targeted.

The problem, really, is that we receive the click coordinates as absolute coordinates within the terminal. However, we are just one widget handling this event. We do not know where we are within the overall terminal layout, and so we can't apply offsets to the event to determine where within the current widget the click occurred. In fact, we can't event tell if the click was within the boundaries of the current widget right now.

Fixing this requires teaching all of our layout types (and those provided by views about how to properly handle mouse events. Alternatively, we can implement our own widget framework (loosely based on views) that handles this kind of thing correctly. Either way, it'll be an annoying chunk of work.

Assigned to
4 months ago
4 months ago
feature wisteria