Fix frame size is incorrect when maximize app window
@@ -341,8 +341,13 @@ class RideFrame(wx.Frame):
wx.CloseEvent.Veto(event)
def OnSize(self, event):
- self._application.settings['mainframe maximized'] = self.IsMaximized()
- self._application.settings['mainframe size'] = self.DoGetSize()
+ size = self.DoGetSize()
+ is_full_screen_mode = size == wx.DisplaySize()
+ self._application.settings['mainframe maximized'] = self.IsMaximized() or is_full_screen_mode
+ if not is_full_screen_mode:
+ self._application.settings['mainframe size'] = size
+ self._application.settings['mainframe position'] = \
+ self.DoGetPosition()
event.Skip()
def OnMove(self, event):
