# How to get the available desktop area in SDL2

**URL:** <https://discourse.libsdl.org/t/how-to-get-the-available-desktop-area-in-sdl2/19646>\
**Category:** SDL Development\
**Created:** [June 3, 2013, 6:00am UTC](https://discourse.libsdl.org/t/how-to-get-the-available-desktop-area-in-sdl2/19646 "2013-06-03T06:00:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Park](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/f9ae1b/32.png) [@Tony\_Park](https://discourse.libsdl.org/u/Tony_Park)\
**Post date:** [June 3, 2013, 6:00am UTC](https://discourse.libsdl.org/t/how-to-get-the-available-desktop-area-in-sdl2/19646/1 "2013-06-03T06:00:26Z")

</div>

How do I work out the maximum available desktop area, taking into  
account desktop furniture such as taskbars? I also need to find the size  
of the title bars and borders for windows.

The reason is I want to make a window as large as possible for the  
current display, but I do not want to use a maximised window because I  
want to keep to a fixed aspect ratio.

Thanks

Tony

---

<div class="post-metadata">

**Author:** ![Alex\_Barry](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/alex_barry/32/515_2.png) [@Alex\_Barry](https://discourse.libsdl.org/u/Alex_Barry)\
**Post date:** [June 3, 2013, 12:15pm UTC](https://discourse.libsdl.org/t/how-to-get-the-available-desktop-area-in-sdl2/19646/2 "2013-06-03T12:15:35Z")

</div>

I don’t think you can get taskbar sizing/space, or at least not directly  
through the SDL api, but just for the desktop area, you can enumerate the  
desktops available, and get their respective resolutions with  
[http://wiki.libsdl.org/moin.fcg/SDL\_GetNumVideoDisplays](http://wiki.libsdl.org/moin.fcg/SDL_GetNumVideoDisplays) and  
[http://wiki.libsdl.org/moin.fcg/SDL\_GetDisplayBounds](http://wiki.libsdl.org/moin.fcg/SDL_GetDisplayBounds)

I don’t know of any api-specific ways of getting the task bar  
placement/size off hand, but maybe someone else on the list/forum can point  
you in the right direction.

-AlexOn Mon, Jun 3, 2013 at 2:00 AM, Tony Park wrote:

> How do I work out the maximum available desktop area, taking into account  
> desktop furniture such as taskbars? I also need to find the size of the  
> title bars and borders for windows.
> 
> The reason is I want to make a window as large as possible for the current  
> display, but I do not want to use a maximised window because I want to keep  
> to a fixed aspect ratio.
> 
> Thanks
> 
> Tony  
> \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/\*\*listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org)[http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
