diff --git a/gui/wxpython/lmgr/frame.py b/gui/wxpython/lmgr/frame.py index 0f0b09a0e58..b26d7b476f2 100644 --- a/gui/wxpython/lmgr/frame.py +++ b/gui/wxpython/lmgr/frame.py @@ -255,6 +255,13 @@ def show_menu_errors(messages): try: x, y = map(int, dim.split(",")[0:2]) w, h = map(int, dim.split(",")[2:4]) + client_disp = wx.ClientDisplayRect() + if x == 1: + # Get client display x offset (OS panel) + x = client_disp[0] + if y == 1: + # Get client display y offset (OS panel) + y = client_disp[1] self.SetPosition((x, y)) self.SetSize((w, h)) except: diff --git a/gui/wxpython/main_window/frame.py b/gui/wxpython/main_window/frame.py index 19fa9802ce9..32abfc032c5 100644 --- a/gui/wxpython/main_window/frame.py +++ b/gui/wxpython/main_window/frame.py @@ -177,16 +177,25 @@ def show_menu_errors(messages): try: x, y = map(int, dim.split(",")[0:2]) w, h = map(int, dim.split(",")[2:4]) + client_disp = wx.ClientDisplayRect() + if x == 1: + # Get client display x offset (OS panel) + x = client_disp[0] + if y == 1: + # Get client display y offset (OS panel) + y = client_disp[1] self.SetPosition((x, y)) self.SetSize((w, h)) except Exception: pass + self.Layout() + self.Fit() else: + self.Layout() + self.Fit() # does center (of screen) make sense for lmgr? self.Centre() - self.Layout() - self.Fit() self.Show() # load workspace file if requested diff --git a/gui/wxpython/mapdisp/frame.py b/gui/wxpython/mapdisp/frame.py index 794ed1dd218..5d26c4b9fc1 100644 --- a/gui/wxpython/mapdisp/frame.py +++ b/gui/wxpython/mapdisp/frame.py @@ -1714,16 +1714,26 @@ def __init__(self, parent, giface, id, tree, lmgr, idx, Map, title, **kwargs): ) ) # use default frame window layout + client_disp = wx.ClientDisplayRect() if UserSettings.Get(group="general", key="defWindowPos", subkey="enabled"): dim = UserSettings.Get(group="general", key="defWindowPos", subkey="dim") idx = 4 + idx * 4 try: x, y = map(int, dim.split(",")[idx : idx + 2]) w, h = map(int, dim.split(",")[idx + 2 : idx + 4]) + if x == 1: + # Get client display x offset (OS panel) + x = client_disp[0] + if y == 1: + # Get client display y offset (OS panel) + y = client_disp[1] parent.SetPosition((x, y)) parent.SetSize((w, h)) except Exception: pass + else: + # Set client display x, y offset (OS panel) + parent.SetPosition((client_disp[0], client_disp[1])) # bindings parent.Bind(wx.EVT_CLOSE, self.OnCloseWindow)