chiark / gitweb /
Fix event skipping. Horrible e.Skip() naming...
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Wed, 7 Jan 2015 19:24:56 +0000 (14:24 -0500)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Wed, 7 Jan 2015 19:25:24 +0000 (14:25 -0500)
e.Skip() MUST be called otherwise other handlers for the event won't be called

Cura/gui/app.py
Cura/gui/splashScreen.py

index 43f6bae51b3fa22b56a7bb89ce6b6cd1fad32efd..5b86fb008e96c4baa6e20f19e54998622901519f 100644 (file)
@@ -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
index 27463f5fe2e5f26f868552b4199f2a8f0886e31b..44bad77acd2db0cf8c08439ce201776b294b020e 100644 (file)
@@ -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()