Added focus to preferences & log windows when put to foreground