Refactor the code of invoking Lua overriding method.
Support reopen window on clicking dock icon.