aboutsummaryrefslogtreecommitdiff
path: root/voctogui/lib/warningoverlay.py
diff options
context:
space:
mode:
Diffstat (limited to 'voctogui/lib/warningoverlay.py')
-rw-r--r--voctogui/lib/warningoverlay.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/voctogui/lib/warningoverlay.py b/voctogui/lib/warningoverlay.py
index 6df932e..3cbe13c 100644
--- a/voctogui/lib/warningoverlay.py
+++ b/voctogui/lib/warningoverlay.py
@@ -1,5 +1,5 @@
import logging
-from gi.repository import GLib, Gst
+from gi.repository import GLib, Gst, cairo
from lib.config import Config
@@ -46,6 +46,12 @@ class VideoWarningOverlay(object):
w = self.width
h = self.height / 20
+ # during startup, cr is sometimes another kind of context,
+ # which does not expose set_source_rgba and other methods.
+ # this check avoids the exceptions that would be thrown then.
+ if isinstance(cr, cairo.Context):
+ return
+
if self.blink_state:
cr.set_source_rgba(1.0, 0.0, 0.0, 0.8)
else: