From db276909baff15bcc972fec82e19a73c49c9dd00 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 13 Jun 2021 12:51:58 -0400 Subject: [PATCH] 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 --- common/eda_base_frame.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index e69d8e853f..83d3376f22 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -568,20 +568,10 @@ void EDA_BASE_FRAME::LoadWindowState( const WINDOW_STATE& aState ) wxDisplay display( aState.display ); wxRect clientSize = display.GetClientArea(); -#ifndef _WIN32 - // The percentage size (represented in decimal) of the region around the screen's border where - // an upper corner is not allowed - #define SCREEN_BORDER_REGION 0.10 -#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 ) ); + int yLimTop = clientSize.y; + int yLimBottom = clientSize.y + clientSize.height; + int xLimLeft = clientSize.x; + int xLimRight = clientSize.x + clientSize.width; 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