From 9dd07e591b115c9083d787206078a7dd6ce94c6b Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Sat, 11 Feb 2023 12:59:57 +0800 Subject: [PATCH] hide window before init is done --- source/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/window.cpp b/source/window.cpp index 3d4870d..6deb4c0 100644 --- a/source/window.cpp +++ b/source/window.cpp @@ -71,6 +71,8 @@ bool Window::run(OptionParser& parser) { player->onDropEvent(count, openedFileNames); } #endif + glfwShowWindow(window); + glfwFocusWindow(window); std::atomic_bool shutdown = false; @@ -161,6 +163,8 @@ void Window::initGLFW(const char* title) { glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); #endif + glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); + glfwWindowHint(GLFW_FOCUSED, GLFW_FALSE); GLFWmonitor* monitor = glfwGetPrimaryMonitor(); const GLFWvidmode* mode = glfwGetVideoMode(monitor);