From 82728e148e19dfaaed52e3660c3888f2c5fee6e0 Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Thu, 22 Dec 2011 15:46:47 +0100 Subject: [PATCH 1/2] #906926 fix stay on top for OS X --- openlp/core/ui/maindisplay.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 328970d45..e99e98f1d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -29,6 +29,7 @@ The :mod:`maindisplay` module provides the functionality to display screens and play multimedia within OpenLP. """ import logging +import platform from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL from PyQt4.phonon import Phonon @@ -60,7 +61,12 @@ class Display(QtGui.QGraphicsView): self.controller = controller self.screen = {} self.plugins = PluginManager.get_instance().plugins - self.setViewport(QtOpenGL.QGLWidget()) + # FIXME: On Mac OS X (tested on 10.7) the display screen is corrupt with + # 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 platform.system() != 'Darwin': + self.setViewport(QtOpenGL.QGLWidget()) def setup(self): """ @@ -120,9 +126,15 @@ class MainDisplay(Display): self.audioPlayer = None self.firstTime = True self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;') - self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | - QtCore.Qt.WindowStaysOnTopHint | - QtCore.Qt.X11BypassWindowManagerHint) + windowFlags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | \ + QtCore.Qt.WindowStaysOnTopHint | \ + QtCore.Qt.X11BypassWindowManagerHint + # FIXME: QtCore.Qt.SplashScreen is workaround to make display screen + # stay always on top on Mac OS X. For details see bug 906926. + # It needs more investigation to fix it properly. + if platform.system() == 'Darwin': + windowFlags = windowFlags | QtCore.Qt.SplashScreen + self.setWindowFlags(windowFlags) self.setAttribute(QtCore.Qt.WA_DeleteOnClose) if self.isLive: QtCore.QObject.connect(Receiver.get_receiver(), From 4071bc8deb18fe7fe233cca9138d5b30e37c7727 Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Thu, 22 Dec 2011 19:21:22 +0100 Subject: [PATCH 2/2] remove disabling opengl - done in new branch --- openlp/core/ui/maindisplay.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index e99e98f1d..4e314d747 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -61,12 +61,7 @@ class Display(QtGui.QGraphicsView): self.controller = controller self.screen = {} self.plugins = PluginManager.get_instance().plugins - # FIXME: On Mac OS X (tested on 10.7) the display screen is corrupt with - # 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 platform.system() != 'Darwin': - self.setViewport(QtOpenGL.QGLWidget()) + self.setViewport(QtOpenGL.QGLWidget()) def setup(self): """