forked from openlp/openlp
Hide the main impress window when loading a presentation, but make it visible for a moment when starting presentation. Hopefully fixes bug 1420356.
Fixes: https://launchpad.net/bugs/1420356
This commit is contained in:
parent
f0232d7147
commit
bee9808503
@ -231,21 +231,13 @@ class ImpressDocument(PresentationDocument):
|
|||||||
return False
|
return False
|
||||||
self.desktop = desktop
|
self.desktop = desktop
|
||||||
properties = []
|
properties = []
|
||||||
if not is_win():
|
properties.append(self.create_property('Hidden', True))
|
||||||
# Recent versions of Impress on Windows won't start the presentation if it starts as minimized. It seems OK
|
|
||||||
# on Linux though.
|
|
||||||
properties.append(self.create_property('Minimized', True))
|
|
||||||
properties = tuple(properties)
|
properties = tuple(properties)
|
||||||
try:
|
try:
|
||||||
self.document = desktop.loadComponentFromURL(url, '_blank', 0, properties)
|
self.document = desktop.loadComponentFromURL(url, '_blank', 0, properties)
|
||||||
except:
|
except:
|
||||||
log.warning('Failed to load presentation %s' % url)
|
log.warning('Failed to load presentation %s' % url)
|
||||||
return False
|
return False
|
||||||
if is_win():
|
|
||||||
# As we can't start minimized the Impress window gets in the way.
|
|
||||||
# Either window.setPosSize(0, 0, 200, 400, 12) or .setVisible(False)
|
|
||||||
window = self.document.getCurrentController().getFrame().getContainerWindow()
|
|
||||||
window.setVisible(False)
|
|
||||||
self.presentation = self.document.getPresentation()
|
self.presentation = self.document.getPresentation()
|
||||||
self.presentation.Display = ScreenList().current['number'] + 1
|
self.presentation.Display = ScreenList().current['number'] + 1
|
||||||
self.control = None
|
self.control = None
|
||||||
@ -382,6 +374,8 @@ class ImpressDocument(PresentationDocument):
|
|||||||
"""
|
"""
|
||||||
log.debug('start presentation OpenOffice')
|
log.debug('start presentation OpenOffice')
|
||||||
if self.control is None or not self.control.isRunning():
|
if self.control is None or not self.control.isRunning():
|
||||||
|
window = self.document.getCurrentController().getFrame().getContainerWindow()
|
||||||
|
window.setVisible(True)
|
||||||
self.presentation.start()
|
self.presentation.start()
|
||||||
self.control = self.presentation.getController()
|
self.control = self.presentation.getController()
|
||||||
# start() returns before the Component is ready. Try for 15 seconds.
|
# start() returns before the Component is ready. Try for 15 seconds.
|
||||||
@ -390,6 +384,7 @@ class ImpressDocument(PresentationDocument):
|
|||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
sleep_count += 1
|
sleep_count += 1
|
||||||
self.control = self.presentation.getController()
|
self.control = self.presentation.getController()
|
||||||
|
window.setVisible(False)
|
||||||
else:
|
else:
|
||||||
self.control.activate()
|
self.control.activate()
|
||||||
self.goto_slide(1)
|
self.goto_slide(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user