---
name: "SDL_GetWindowBordersSize"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetWindowBordersSize"
---

# SDL\_GetWindowBordersSize(3)

Get the size of a window's borders (decorations) around the client area.

## NAME

SDL\_GetWindowBordersSize - Get the size of a window's borders (decorations) around the client area.

## HEADER FILE

Defined in SDL3/SDL\_video.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_GetWindowBordersSize(SDL\_Window \*window, int \*top, int \*left, int \*bottom, int \*right);**

## DESCRIPTION

Note: If this function fails (returns false), the size values will be initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as if the window in question was borderless.

Note: This function may fail on systems where the window has not yet been decorated by the display server (for example, immediately after calling

**SDL\_CreateWindow** ). It is recommended that you wait at least until the window has been presented and composited, so that the window system has a chance to decorate the window and provide the border dimensions to SDL.

This function also returns false if getting the information is not supported.

## FUNCTION PARAMETERS

- *window*

  the window to query the size values of the border (decorations) from.

- *top*

  pointer to variable for storing the size of the top border; NULL is permitted.

- *left*

  pointer to variable for storing the size of the left border; NULL is permitted.

- *bottom*

  pointer to variable for storing the size of the bottom border; NULL is permitted.

- *right*

  pointer to variable for storing the size of the right border; NULL is permitted.

## 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

**•**(3), [**SDL\_GetWindowSize**(3)](/SDL_GetWindowSize/3.md)
