glfwFocusWindow function

void glfwFocusWindow(
  1. Pointer<GLFWwindow> window
)

! @brief Brings the specified window to front and sets input focus.

This function brings the specified window to front and sets input focus. The window should already be visible and not iconified.

By default, both windowed and full screen mode windows are focused when initially created. Set the GLFW_FOCUSED(@ref GLFW_FOCUSED_hint) to disable this behavior.

Also by default, windowed mode windows are focused when shown with @ref glfwShowWindow. Set the GLFW_FOCUS_ON_SHOW(@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior.

Do not use this function to steal focus from other applications unless you are certain that is what the user wants. Focus stealing can be extremely disruptive.

For a less disruptive way of getting the user's attention, see attention requests(@ref window_attention).

@paramin window The window to give input focus.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_PLATFORM_ERROR.

@remark @wayland It is not possible for an application to bring its windows to front, this function will always emit @ref GLFW_PLATFORM_ERROR.

@thread_safety This function must only be called from the main thread.

@sa @ref window_focus @sa @ref window_attention

@since Added in version 3.2.

@ingroup window

GLFWAPI void glfwFocusWindow(GLFWwindow* window)

Implementation

void glfwFocusWindow(Pointer<GLFWwindow> window) {
  final glfwFocusWindowLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWwindow> window),
      void Function(Pointer<GLFWwindow> window)>('glfwFocusWindow');
  return glfwFocusWindowLookupFunction(window);
}