@@ -8,7 +8,6 @@ namespace EOS
88 // / Setup the error callback
99 glfwSetErrorCallback ([](int error, const char * message)
1010 {
11- // Logger->error("GLFW: {}, {}", error, message);
1211 printf (fmt::format (" GLFW: {}, {}" , error, message).c_str ());
1312 });
1413
@@ -71,8 +70,8 @@ namespace EOS
7170 glfwSetWindowPos (GlfwWindow, x, y);
7271 }
7372
74- // Get the actual window size and store it
7573#if defined(EOS_PLATFORM_WINDOWS)
74+ // Get the actual window size and store it
7675 glfwGetFramebufferSize (GlfwWindow, &Width, &Height);
7776#endif
7877
@@ -89,6 +88,7 @@ namespace EOS
8988 });
9089
9190 glfwSetInputMode (GlfwWindow, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
91+ glfwFocusWindow (GlfwWindow);
9292
9393#if defined(EOS_PLATFORM_WAYLAND)
9494 contextDescription.Window = static_cast <void *>(glfwGetWaylandWindow (GlfwWindow));
@@ -111,7 +111,6 @@ namespace EOS
111111 void Window::Poll ()
112112 {
113113 glfwPollEvents ();
114- glfwGetFramebufferSize (GlfwWindow, &Width, &Height);
115114 }
116115
117116 bool Window::ShouldClose () const
@@ -121,7 +120,8 @@ namespace EOS
121120
122121 bool Window::IsFocused () const
123122 {
124- return glfwGetWindowAttrib (GlfwWindow, GLFW_FOCUSED);
123+ glfwGetFramebufferSize (GlfwWindow, &Width, &Height);
124+ return Width || Height;
125125 }
126126}
127127
0 commit comments