From 0167f0ab4ebc35f62c60c69708a84e6e9bbbbe72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 5 Feb 2021 19:15:15 +0100 Subject: [PATCH] Draw black background from CSS when GL fails When GLArea gets a GL error it leaves user with nothing, but transparent background with error text in the middle. Make it look somewhat decent by drawing black background for the not working video widget. --- css/styles.css | 5 +++++ src/player.js | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/css/styles.css b/css/styles.css index f226f0cd..d1712fb1 100644 --- a/css/styles.css +++ b/css/styles.css @@ -285,3 +285,8 @@ radio { .brightscale trough highlight { filter: brightness(120%); } + +/* Error BG */ +.blackbackground { + background: black; +} diff --git a/src/player.js b/src/player.js index 9f8e85d2..2d20d5ae 100644 --- a/src/player.js +++ b/src/player.js @@ -467,6 +467,16 @@ class ClapperPlayer extends PlayerBase this.widget.disconnect(this._realizeSignal); this._realizeSignal = null; + if(this.widget.get_error) { + const error = this.widget.get_error(); + if(error) { + debug('player widget error detected'); + debug(error); + + this.widget.add_css_class('blackbackground'); + } + } + const root = this.widget.get_root(); if(!root) return;