Skip to content

Commit c9752cb

Browse files
author
gfdsa
committed
https://github.com/adamn/python-webkit2png/issues/16
adamn#25
1 parent 22f8de9 commit c9752cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

webkit2png/webkit2png.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def render(self, url):
131131
# QApplication.processEvents may be called, causing
132132
# this method to get called while it has not returned yet.
133133
helper = _WebkitRendererHelper(self)
134+
helper._window.resize( self.width, self.height )
134135
image = helper.render(url)
135136

136137
# Bind helper instance to this image to prevent the
@@ -224,8 +225,9 @@ def render(self, url):
224225
if self.wait > 0:
225226
if self.logger: self.logger.debug("Waiting %d seconds " % self.wait)
226227
waitToTime = time.time() + self.wait
227-
while time.time() < waitToTime and QApplication.hasPendingEvents():
228-
QApplication.processEvents()
228+
while time.time() < waitToTime:
229+
if QApplication.hasPendingEvents():
230+
QApplication.processEvents()
229231

230232
if self.renderTransparentBackground:
231233
# Another possible drawing solution

0 commit comments

Comments
 (0)