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.
This commit is contained in:
Rafał Dzięgiel
2021-02-05 19:15:15 +01:00
parent 4aef4b2723
commit 0167f0ab4e
2 changed files with 15 additions and 0 deletions

View File

@@ -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;