It's not really a code problem but I do have a question.
I know by default, window focus is false. By why when a window is clicked and comes "into focus", that window variable doesn't become true. Does it have to be forced? If so, that is incredibly annoying.