Function SDL_SetWindowAlwaysOnTop

pub unsafe extern "C" fn SDL_SetWindowAlwaysOnTop(
    window: *mut SDL_Window,
    on_top: bool,
) -> bool
Available on crate feature dep_sdl3 only.
Expand description

Set the window to always be above the others.

This will add or remove the window’s SDL_WINDOW_ALWAYS_ON_TOP flag. This will bring the window to the front and keep the window above the rest.

§Parameters

  • window: the window of which to change the always on top state.
  • on_top: true to set the window always on top, false to disable.

§Return value

Returns true on success or false on failure; call SDL_GetError() for more information.

§Thread safety

This function should only be called on the main thread.

§Availability

This function is available since SDL 3.2.0.

§See also