Fix minimizing from taskbar and system menu