From c930ba5d088498d0bf7d16dd6b73445844301e14 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Wed, 7 Jan 2015 14:24:56 -0500 Subject: [PATCH] Fix event skipping. Horrible e.Skip() naming... e.Skip() MUST be called otherwise other handlers for the event won't be called --- Cura/gui/app.py | 10 +++++----- Cura/gui/splashScreen.py | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cura/gui/app.py b/Cura/gui/app.py index 43f6bae5..5b86fb00 100644 --- a/Cura/gui/app.py +++ b/Cura/gui/app.py @@ -26,7 +26,8 @@ class CuraApp(wx.App): self.splash = None self.loadFiles = files - self.Bind(wx.EVT_ACTIVATE_APP, self.OnActivate) + if platform.system() == "Darwin": + self.Bind(wx.EVT_ACTIVATE_APP, self.OnActivate) if sys.platform.startswith('win'): #Check for an already running instance, if another instance is running load files in there @@ -79,10 +80,9 @@ class CuraApp(wx.App): pass def OnActivate(self, e): - if platform.system() == "Darwin": - if e.GetActive(): - self.GetTopWindow().Raise() - e.Skip() + if e.GetActive(): + self.GetTopWindow().Raise() + e.Skip() def Win32SocketListener(self, port): import socket diff --git a/Cura/gui/splashScreen.py b/Cura/gui/splashScreen.py index 27463f5f..44bad77a 100644 --- a/Cura/gui/splashScreen.py +++ b/Cura/gui/splashScreen.py @@ -19,7 +19,8 @@ class splashScreen(wx.SplashScreen): def OnClose(self, e): if self.callback: - # Avoid calling the callback twice - self.callback() - self.callback = None + # Avoid calling the callback twice + self.callback() + self.callback = None wx.CallAfter(self.DoDestroy) + e.Skip() -- 2.30.2