State of a viewport of graphics/graphics

Would it be possible to add a procedure to library graphics/graphics showing the state of a viewport (open, hidden or closed)? When closing a viewport in the title bar (upper right corner)
while the program is waiting for a mouse-click or a key-press, the program keeps waiting without warning and doing nothing. When a viewport has been closed no such event can be posted. Just issuing a warning when closing a viewport would do as well.