[PATCH]: use _platform_window functions only for main windows