mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Performance: add option to disable window shadows
Rendering window shadows in GTK4 doubles GPU usage. This commit adds an option to disable them for performance gain (useful on low-end devices).
This commit is contained in:
@@ -62,7 +62,6 @@ class ClapperPlayerBase extends GstPlayer.Player
|
||||
this.widget = gtkglsink.widget;
|
||||
this.widget.vexpand = true;
|
||||
this.widget.hexpand = true;
|
||||
this.widget.set_opacity(0);
|
||||
|
||||
this.visualization_enabled = false;
|
||||
|
||||
@@ -192,6 +191,20 @@ class ClapperPlayerBase extends GstPlayer.Player
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'render-shadows':
|
||||
let root = this.widget.get_root();
|
||||
if(root && root.isClapperApp) {
|
||||
let cssClass = 'gpufriendly';
|
||||
let renderShadows = settings.get_boolean('render-shadows');
|
||||
let hasShadows = !root.has_css_class(cssClass);
|
||||
|
||||
if(renderShadows === hasShadows)
|
||||
break;
|
||||
|
||||
let action = (renderShadows) ? 'remove' : 'add';
|
||||
root[action + '_css_class'](cssClass);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user