chiark / gitweb /
Add stupidMacOSworkaround.
authordaid <daid303@gmail.com>
Thu, 13 Feb 2014 14:28:03 +0000 (15:28 +0100)
committerdaid <daid303@gmail.com>
Thu, 13 Feb 2014 14:28:03 +0000 (15:28 +0100)
Cura/gui/app.py

index 3dd6cafd6e072d73d4370fc944420361d4e2fd5a..3140e33bdcebc460e72ea909c212d7b8ac74e3f7 100644 (file)
@@ -155,6 +155,19 @@ class CuraApp(wx.App):
 
                setFullScreenCapable(self.mainWindow)
 
+               if sys.platform.startswith('darwin'):
+                       wx.CallAfter(self.StupidMacOSWorkaround)
+
+       def StupidMacOSWorkaround(self):
+               """
+               On MacOS for some magical reason opening new frames does not work until you opened a new modal dialog and closed it.
+               If we do this from software, then, as if by magic, the bug which prevents opening extra frames is gone.
+               """
+               dlg = wx.Dialog(None)
+               wx.PostEvent(dlg, wx.CommandEvent(wx.EVT_CLOSE.typeId))
+               dlg.ShowModal()
+               dlg.Destroy()
+
 if platform.system() == "Darwin": #Mac magic. Dragons live here. THis sets full screen options.
        try:
                import ctypes, objc