Implement minimize window on X button click