to replicate: start drawing a selection rectangle, then alt-tab while still holding down left mouse button. When you return to the game window, the selection box will be static on the screen and cannot be cleared.
The MouseUp event never fires, which I assume is where the rectangle adorner layer is cleared.
I'm not sure if we can set up an event which triggers when we lose focus of the window. If not, a possible solution is to have the MouseDown event clear any existing adorners prior to drawing a new one.
to replicate: start drawing a selection rectangle, then alt-tab while still holding down left mouse button. When you return to the game window, the selection box will be static on the screen and cannot be cleared.
The MouseUp event never fires, which I assume is where the rectangle adorner layer is cleared.
I'm not sure if we can set up an event which triggers when we lose focus of the window. If not, a possible solution is to have the MouseDown event clear any existing adorners prior to drawing a new one.