Merge lp:~raoul-snyman/openlp/bug-1041366 into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Merged at revision: 2048
Proposed branch: lp:~raoul-snyman/openlp/bug-1041366
Merge into: lp:openlp
Diff against target: 35 lines (+10/-0)
1 file modified
openlp/core/lib/renderer.py (+10/-0)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/bug-1041366
Reviewer Review Type Date Requested Status
OpenLP Core Pending
Review via email: mp+121285@code.launchpad.net

Commit message

Fix bug #1041366: Specified size display area not working.

Description of the change

Put the old code back in.

To post a comment you must log in.
Revision history for this message
Jonathan Corwin (j-corwin) wrote :
Revision history for this message
Jonathan Corwin (j-corwin) wrote :

Sorry to say that bug 1016843 reoccurs with this branch :(

lp:~raoul-snyman/openlp/bug-1041366 updated
2047. By Raoul Snyman

Force the garbage collector to run.

Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

Sorry, Raoul. In IRC I said you should add "self.web_frame = self.web.page().mainFrame()" to the update_display() method. But that was wrong.

I do not have a dev box here so I cannot test it myself. Maybe it is enough to create an empty page instead of a whole webview.

self.web.setPage(QtWebKit.QWebPage())

But really, I don't know if that works (and fixes the bug) and if it is faster/slower.

Revision history for this message
Jonathan Corwin (j-corwin) wrote :

I've worked around the bug 1016843 problem in my branch of this branch...
https://code.launchpad.net/~j-corwin/openlp/bug-1041366-jc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/renderer.py'
2--- openlp/core/lib/renderer.py 2012-07-02 18:45:03 +0000
3+++ openlp/core/lib/renderer.py 2012-08-24 22:21:18 +0000
4@@ -27,6 +27,7 @@
5 ###############################################################################
6
7 import logging
8+import gc
9
10 from PyQt4 import QtGui, QtCore, QtWebKit
11
12@@ -96,6 +97,7 @@
13 self.display.close()
14 self.display = MainDisplay(None, self.image_manager, False, self)
15 self.display.setup()
16+ #self.web_frame = self.web.page().mainFrame()
17 self._theme_dimensions = {}
18
19 def update_theme(self, theme_name, old_theme_name=None, only_delete=False):
20@@ -406,7 +408,15 @@
21 if theme_data.font_main_shadow:
22 self.page_width -= int(theme_data.font_main_shadow_size)
23 self.page_height -= int(theme_data.font_main_shadow_size)
24+ # For the life of my I don't know why we have to completely kill the
25+ # QWebView in order for the display to work properly, but we do. See
26+ # bug #1041366 for an example of what happens if we take this out.
27+ self.web = None
28+ gc.collect()
29+ self.web = QtWebKit.QWebView()
30+ self.web.setVisible(False)
31 self.web.resize(self.page_width, self.page_height)
32+ self.web_frame = self.web.page().mainFrame()
33 # Adjust width and height to account for shadow. outline done in css.
34 html = u"""<!DOCTYPE html><html><head><script>
35 function show_text(newtext) {