diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 39a7b1cd..76cc9d55 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3249,18 +3249,18 @@ void FurnaceGUI::pointMotion(int x, int y, int xrel, int yrel) { // how many pixels should be visible at least at x/y dir #define OOB_PIXELS_SAFETY 25 -bool FurnaceGUI::detectOutOfBoundsWindow() { +bool FurnaceGUI::detectOutOfBoundsWindow(SDL_Rect& failing) { int count=SDL_GetNumVideoDisplays(); if (count<1) { - logW("bounds check: error %s",SDL_GetError()); + logW("bounds check: error: %s",SDL_GetError()); return false; } SDL_Rect rect; for (int i=0; i=scrX); @@ -3268,6 +3268,7 @@ bool FurnaceGUI::detectOutOfBoundsWindow() { logD("bounds check: display %d is at %dx%dx%dx%d: %s%s",i,rect.x+OOB_PIXELS_SAFETY,rect.y+OOB_PIXELS_SAFETY,rect.x+rect.w-OOB_PIXELS_SAFETY,rect.y+rect.h-OOB_PIXELS_SAFETY,xbound?"x":"",ybound?"y":""); if (xbound && ybound) { + failing=rect; return true; } } @@ -6007,10 +6008,23 @@ bool FurnaceGUI::init() { #ifndef IS_MOBILE // if window would spawn out of bounds, force it to be get default position - if (!detectOutOfBoundsWindow()) { + SDL_Rect bounds; + if (!detectOutOfBoundsWindow(bounds)) { scrMax=false; scrX=scrConfX=SDL_WINDOWPOS_CENTERED; scrY=scrConfY=SDL_WINDOWPOS_CENTERED; + + // make sure our window isn't big + if (bounds.w