mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-21 07:31:26 +02:00
even better desktop size detection, now accounts for taskbars / panels
This commit is contained in:
@@ -164,10 +164,12 @@ int SDLOpen()
|
|||||||
int displayIndex = SDL_GetWindowDisplayIndex(sdl_window);
|
int displayIndex = SDL_GetWindowDisplayIndex(sdl_window);
|
||||||
if (displayIndex >= 0)
|
if (displayIndex >= 0)
|
||||||
{
|
{
|
||||||
SDL_DisplayMode SDLDisplayMode;
|
SDL_Rect rect;
|
||||||
SDL_GetCurrentDisplayMode(0, &SDLDisplayMode);
|
if (!SDL_GetDisplayUsableBounds(displayIndex, &rect))
|
||||||
desktopWidth = SDLDisplayMode.w;
|
{
|
||||||
desktopHeight = SDLDisplayMode.h;
|
desktopWidth = rect.w;
|
||||||
|
desktopHeight = rect.h;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN
|
#ifdef WIN
|
||||||
@@ -602,7 +604,7 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
SDLOpen();
|
SDLOpen();
|
||||||
// TODO: mabe make a nice loop that automagically finds the optimal scale
|
// TODO: mabe make a nice loop that automagically finds the optimal scale
|
||||||
if (Client::Ref().IsFirstRun() && desktopWidth > WINDOWW*2+50 && desktopHeight > WINDOWH*2+50)
|
if (Client::Ref().IsFirstRun() && desktopWidth > WINDOWW*2+30 && desktopHeight > WINDOWH*2+30)
|
||||||
{
|
{
|
||||||
scale = 2;
|
scale = 2;
|
||||||
Client::Ref().SetPref("Scale", 2);
|
Client::Ref().SetPref("Scale", 2);
|
||||||
|
Reference in New Issue
Block a user