Commit 775afa8f authored by Guillaume Seguin's avatar Guillaume Seguin

Drop ugly hack of a4cc6b27 by delaying the update with wx.CallAfter

parent f13e4f32
......@@ -288,24 +288,16 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.Thaw()
def on_resize(self, event):
wx.CallAfter(self.on_resize_real)
event.Skip()
def on_resize_real(self):
maximized = self.IsMaximized()
self.set("last_window_maximized", maximized)
# FIXME: Hack ! it seems IsMaximized() is not always up to date when
# getting this event during unmaximization, so let's compare the window
# size to the available screensize. Yes, it's horrible.
if maximized:
evtsz = event.GetSize()
display = wx.Display(wx.Display.GetFromWindow(self))
area = display.GetClientArea()
# Ugly ! add some extra -20 padding to ensure we are not missing
# something
if evtsz[0] < area[2] - 20 or evtsz[1] < area[3] - 20:
self.set("last_window_maximized", False)
if not maximized and not self.IsIconized():
size = self.GetSize()
size = self.GetClientSize()
self.set("last_window_width", size[0])
self.set("last_window_height", size[1])
event.Skip()
def on_maximize(self, event):
self.set("last_window_maximized", self.IsMaximized())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment