[go: up one dir, main page]

glfwFocusWindow

Function glfwFocusWindow 

Source
pub unsafe extern "C" fn glfwFocusWindow(window: *mut GLFWwindow)
Expand description

@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).

@param[in] window The window to give input focus.

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

@remark @wayland The compositor will likely ignore focus requests unless another window created by the same application already has input focus.

@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