Elementa
Elementa copied to clipboard
Window: Avoid processing input events if cancelDrawing=true
Otherwise, it is possible that a Window allows clicks or key types to trigger when it is invisible
Not opposed in principle but not handling e.g. the mouse click events means that the OverlayManager will think that the screen did consume the event (because its final handler didn't get called) and therefore prevent it from reaching lower layers as well as the original screen, arguably worse than the current behavior. So if we do do this, then we must also expose
cancelDrawing(probably under a more descriptive name likehasErrored), so the overlay manager can skip and/or dispose of layers that are broken.
I've changed cancelDrawing to hasErrored and exposed it