Get rid of screen border region logic

This prevents restoring perfectly-valid screen locations, and
I'm not sure what problem it is trying to solve (it's already
disabled on Windows, and this is confirmed to mess up restoring
locations on Mac/Linux).

If this was actually fixing a problem, the fix needs to be more
targeted, but since I don't know what the problem was, I'm just
going to take it out for now and wait for a potential problem
to pop up again.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8595
This commit is contained in:
Jon Evans 2021-06-13 12:51:58 -04:00
parent 08d56f897c
commit db276909ba
1 changed files with 4 additions and 14 deletions

View File

@ -568,20 +568,10 @@ void EDA_BASE_FRAME::LoadWindowState( const WINDOW_STATE& aState )
wxDisplay display( aState.display ); wxDisplay display( aState.display );
wxRect clientSize = display.GetClientArea(); wxRect clientSize = display.GetClientArea();
#ifndef _WIN32 int yLimTop = clientSize.y;
// The percentage size (represented in decimal) of the region around the screen's border where int yLimBottom = clientSize.y + clientSize.height;
// an upper corner is not allowed int xLimLeft = clientSize.x;
#define SCREEN_BORDER_REGION 0.10 int xLimRight = clientSize.x + clientSize.width;
#else
// Windows uses a very rectangular clearly defined display region, there is no ambiguous "screen border region"
// GetClientArea already accounts for the taskbar stealing display space
#define SCREEN_BORDER_REGION 0
#endif
int yLimTop = clientSize.y + ( clientSize.height * ( SCREEN_BORDER_REGION ) );
int yLimBottom = clientSize.y + ( clientSize.height * ( 1.0 - SCREEN_BORDER_REGION ) );
int xLimLeft = clientSize.x + ( clientSize.width * SCREEN_BORDER_REGION );
int xLimRight = clientSize.x + ( clientSize.width * ( 1.0 - SCREEN_BORDER_REGION ) );
if( upperLeft.x > xLimRight || // Upper left corner too close to right edge of screen if( upperLeft.x > xLimRight || // Upper left corner too close to right edge of screen
upperRight.x < xLimLeft || // Upper right corner too close to left edge of screen upperRight.x < xLimLeft || // Upper right corner too close to left edge of screen