From 17d6f13ac0f91f318cb4186e819cc0790b6979f0 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 6 Feb 2016 20:43:54 +0100 Subject: [PATCH] More workarounds for bug 1531319. Fixes: https://launchpad.net/bugs/1531319 --- openlp/core/ui/maindisplay.py | 18 ++++++++++++++++++ openlp/core/ui/slidecontroller.py | 7 ++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index a16c7c6c0..142f9a047 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -326,6 +326,9 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): else: self.setVisible(False) self.setGeometry(self.screen['size']) + # Workaround for bug #1531319, should not be needed with PyQt 5.6. + if is_win(): + self.shake_web_view() def direct_image(self, path, background): """ @@ -395,8 +398,17 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): # Wait for the fade to finish before geting the preview. # Important otherwise preview will have incorrect text if at all! if self.service_item.theme_data and self.service_item.theme_data.display_slide_transition: + # Workaround for bug #1531319, should not be needed with PyQt 5.6. + if is_win(): + fade_shake_timer = QtCore.QTimer(self) + fade_shake_timer.setInterval(25) + fade_shake_timer.timeout.connect(self.shake_web_view) + fade_shake_timer.start() while not self.frame.evaluateJavaScript('show_text_completed()'): self.application.process_events() + # Workaround for bug #1531319, should not be needed with PyQt 5.6. + if is_win(): + fade_shake_timer.stop() # Wait for the webview to update before getting the preview. # Important otherwise first preview will miss the background ! while not self.web_loaded: @@ -493,6 +505,9 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): if self.isHidden(): self.setVisible(True) self.web_view.setVisible(True) + # Workaround for bug #1531319, should not be needed with PyQt 5.6. + if is_win(): + self.shake_web_view() self.hide_mode = mode def show_display(self): @@ -511,6 +526,9 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): # Trigger actions when display is active again. if self.is_live: Registry().execute('live_display_active') + # Workaround for bug #1531319, should not be needed with PyQt 5.6. + if is_win(): + self.shake_web_view() def _hide_mouse(self): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index bed5d07c4..2579580df 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1101,9 +1101,6 @@ class SlideController(DisplayController, RegistryProperties): self.display.image(to_display) # reset the store used to display first image self.service_item.bg_image_bytes = None - # Workaround for bug #1531319, should not be needed with PyQt 5.6. - if self.is_live and is_win(): - self.display.shake_web_view() self.selected_row = row self.update_preview() self.preview_widget.change_slide(row) @@ -1128,8 +1125,8 @@ class SlideController(DisplayController, RegistryProperties): self.log_debug('update_preview %s ' % self.screens.current['primary']) if self.service_item and self.service_item.is_capable(ItemCapabilities.ProvidesOwnDisplay): # Grab now, but try again in a couple of seconds if slide change is slow - QtCore.QTimer.singleShot(0.5, self.grab_maindisplay) - QtCore.QTimer.singleShot(2.5, self.grab_maindisplay) + QtCore.QTimer.singleShot(500, self.grab_maindisplay) + QtCore.QTimer.singleShot(2500, self.grab_maindisplay) else: self.slide_image = self.display.preview() self.slide_image.setDevicePixelRatio(self.main_window.devicePixelRatio())