diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py
index f35b7450d..c3e4c5f4f 100644
--- a/openlp/core/lib/htmlbuilder.py
+++ b/openlp/core/lib/htmlbuilder.py
@@ -182,8 +182,9 @@ sup {
*/
text.innerHTML = new_text;
text.style.opacity = '1';
- // Wait until the text is completely visible.
- window.setTimeout(function(){timer = null;}, 400);
+ // Wait until the text is completely visible. We want to save the timer id, to be able to call
+ // clearTimeout(timer) when the text has changed before finishing fading.
+ timer = window.setTimeout(function(){timer = null;}, 400);
}
function show_text_completed(){
diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py
index 35e8b6cf8..2cc1aded1 100644
--- a/openlp/core/ui/maindisplay.py
+++ b/openlp/core/ui/maindisplay.py
@@ -346,6 +346,7 @@ class MainDisplay(Display):
"""
Generates a preview of the image displayed.
"""
+ was_visible = self.isVisible()
log.debug(u'preview for %s', self.isLive)
self.application.process_events()
# We must have a service item to preview.
@@ -363,7 +364,8 @@ class MainDisplay(Display):
if self.isLive:
if self.hideMode:
self.hide_display(self.hideMode)
- else:
+ # Only continue if the visibility wasn't changed during method call.
+ elif was_visible == self.isVisible():
# Single screen active
if self.screens.display_count == 1:
# Only make visible if setting enabled.