From 85c329fb269c4d2dc111f2fa42292011cb28f961 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 20 Jan 2016 23:25:40 +0100 Subject: [PATCH] Workaround for windows display not updating, webkit player does not work yet. Partial fix for bug 1531319. Fixes: https://launchpad.net/bugs/1531319 --- openlp/core/ui/maindisplay.py | 9 ++++++++- openlp/core/ui/slidecontroller.py | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 822181c6c..9a5259a5d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -90,7 +90,7 @@ class Display(QtWidgets.QGraphicsView): # OpenGL. Only white blank screen is shown on the 2nd monitor all the # time. We need to investigate more how to use OpenGL properly on Mac OS # X. - if not is_macosx() and not is_win(): + if not is_macosx(): self.setViewport(QtOpenGL.QGLWidget()) def setup(self): @@ -559,6 +559,13 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): if window_id == main_window_id: self.main_window.raise_() + def shake_web_view(self): + """ + Resizes the web_view a bit to force an update. Workaround for bug #1531319, should not be needed with PyQt 5.6. + """ + self.web_view.setGeometry(0, 0, self.width(), self.height()-1) + self.web_view.setGeometry(0, 0, self.width(), self.height()) + class AudioPlayer(OpenLPMixin, QtCore.QObject): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 231c282ba..e2f4a61aa 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -31,7 +31,7 @@ from threading import Lock from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, RegistryProperties, Settings, SlideLimits, UiStrings, translate, \ - RegistryMixin, OpenLPMixin + RegistryMixin, OpenLPMixin, is_win from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, ImageSource, ServiceItemAction, \ ScreenList, build_icon, build_html from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType @@ -1101,6 +1101,9 @@ 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)