mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
handle window that doesn't open properly
This commit is contained in:
parent
bf10ae1386
commit
866b1e19c0
@ -131,6 +131,12 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
if self.config.GetBool('open-default-window', 1):
|
if self.config.GetBool('open-default-window', 1):
|
||||||
self.openMainWindow()
|
self.openMainWindow()
|
||||||
|
|
||||||
|
# Give the window a chance to truly open.
|
||||||
|
self.graphicsEngine.renderFrame()
|
||||||
|
if self.win.isClosed():
|
||||||
|
self.notify.info("Window did not open, removing.")
|
||||||
|
self.closeWindow(self.win)
|
||||||
|
|
||||||
if self.win == None:
|
if self.win == None:
|
||||||
# Try a little harder if the window wouldn't open.
|
# Try a little harder if the window wouldn't open.
|
||||||
self.makeAllPipes()
|
self.makeAllPipes()
|
||||||
@ -139,6 +145,11 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.pipe = self.pipeList[0]
|
self.pipe = self.pipeList[0]
|
||||||
self.openMainWindow()
|
self.openMainWindow()
|
||||||
|
|
||||||
|
self.graphicsEngine.renderFrame()
|
||||||
|
if self.win.isClosed():
|
||||||
|
self.notify.info("Window did not open, removing.")
|
||||||
|
self.closeWindow(self.win)
|
||||||
|
|
||||||
self.loader = Loader.Loader(self)
|
self.loader = Loader.Loader(self)
|
||||||
self.eventMgr = eventMgr
|
self.eventMgr = eventMgr
|
||||||
self.messenger = messenger
|
self.messenger = messenger
|
||||||
@ -501,7 +512,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
# Reset the currently-held modifier button list for good
|
# Reset the currently-held modifier button list for good
|
||||||
# measure.
|
# measure.
|
||||||
bt = base.buttonThrower.node()
|
bt = self.buttonThrower.node()
|
||||||
mb = ModifierButtons(bt.getModifierButtons())
|
mb = ModifierButtons(bt.getModifierButtons())
|
||||||
mb.allButtonsUp()
|
mb.allButtonsUp()
|
||||||
bt.setModifierButtons(mb)
|
bt.setModifierButtons(mb)
|
||||||
@ -618,15 +629,15 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.camLens = self.camNode.getLens()
|
self.camLens = self.camNode.getLens()
|
||||||
|
|
||||||
def getAlt(self):
|
def getAlt(self):
|
||||||
return base.mouseWatcherNode.getModifierButtons().isDown(
|
return self.mouseWatcherNode.getModifierButtons().isDown(
|
||||||
KeyboardButton.alt())
|
KeyboardButton.alt())
|
||||||
|
|
||||||
def getShift(self):
|
def getShift(self):
|
||||||
return base.mouseWatcherNode.getModifierButtons().isDown(
|
return self.mouseWatcherNode.getModifierButtons().isDown(
|
||||||
KeyboardButton.shift())
|
KeyboardButton.shift())
|
||||||
|
|
||||||
def getControl(self):
|
def getControl(self):
|
||||||
return base.mouseWatcherNode.getModifierButtons().isDown(
|
return self.mouseWatcherNode.getModifierButtons().isDown(
|
||||||
KeyboardButton.control())
|
KeyboardButton.control())
|
||||||
|
|
||||||
def addAngularIntegrator(self):
|
def addAngularIntegrator(self):
|
||||||
@ -809,7 +820,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
# Finally, render the frame.
|
# Finally, render the frame.
|
||||||
self.graphicsEngine.renderFrame()
|
self.graphicsEngine.renderFrame()
|
||||||
if self.clusterSyncFlag:
|
if self.clusterSyncFlag:
|
||||||
base.graphicsEngine.syncFrame()
|
self.graphicsEngine.syncFrame()
|
||||||
|
|
||||||
if self.mainWinMinimized:
|
if self.mainWinMinimized:
|
||||||
# If the main window is minimized, slow down the app a bit
|
# If the main window is minimized, slow down the app a bit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user