other way to prevent empty text to be recorded
restore clipboard if we were out of the window