winit icon indicating copy to clipboard operation
winit copied to clipboard

HitTest event

Open msiglreith opened this issue 3 years ago • 1 comments

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_NCHITTEST seems 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

msiglreith avatar Aug 09 '22 16:08 msiglreith

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).

maroider avatar Aug 10 '22 16:08 maroider