winit
winit copied to clipboard
HitTest event
Add a WindowEvent::HitTest(button, x, y, &mut Area) event which allows the user to specify special interaction areas on button clicks. Area maybe one of the borders, the caption, system buttons, etc. Inspired by the WM_NCHITTEST event.
Motivation
- Mostly interesting for windows without decorations where we are usually required to emulate the system behavior.
- On Windows, feedback of the internal
WM_NCHITTESTseems to be used for certain system behavior, ie. snap layout when hovering the maximize button or screen reader support. - Unify the
drag_functions and hopefully improve the 'left button down'-guessing situation
This is something I admittedly contemplated when drag_window was being implemented, but I ultimately didn't bring it up since I wasn't confident it could be meaningfully generalized across platforms (but I suppose that's something we can figure out here).