[gnome] Update extensions

This commit is contained in:
2026-06-10 11:03:09 -04:00
parent 20fc1e4e75
commit 6c973853c6
394 changed files with 12513 additions and 1340 deletions

View File

@ -166,7 +166,7 @@ export const ApplicationsBlur = class ApplicationsBlur {
let window_actor = meta_window.get_compositor_private();
if (
(!meta_window.get_workspace().active) || meta_window.minimized
(!meta_window.get_workspace().active) || meta_window.minimized
)
window_actor.hide();
});
@ -385,10 +385,27 @@ export const ApplicationsBlur = class ApplicationsBlur {
// set the window actor's opacity
this.set_window_opacity(window_actor, this.settings.applications.OPACITY);
// update corner radius based on window state
this.update_corner_radius(meta_window);
// now set up the signals, for the window actor only: they are disconnected
// in `remove_blur`, whereas the signals for the meta window are disconnected
// only when the whole component is disabled
// listen for window state changes (maximized/fullscreen)
this.connections.connect(
meta_window, 'notify::maximized-horizontally',
_ => this.update_corner_radius(meta_window)
);
this.connections.connect(
meta_window, 'notify::maximized-vertically',
_ => this.update_corner_radius(meta_window)
);
this.connections.connect(
meta_window, 'notify::fullscreen',
_ => this.update_corner_radius(meta_window)
);
// update the window opacity when it changes, else we don't control it fully
this.connections.connect(
window_actor, 'notify::opacity',
@ -472,6 +489,33 @@ export const ApplicationsBlur = class ApplicationsBlur {
);
}
/// Update the corner radius based on window state (0 for maximized/fullscreen)
/// if the preferences say so.
update_corner_radius(meta_window) {
const is_maximized = meta_window.maximized_horizontally || meta_window.maximized_vertically;
const is_fullscreen = meta_window.fullscreen;
let use_0_radius = !this.settings.applications.CORNER_WHEN_MAXIMIZED && (is_maximized || is_fullscreen);
if (this.settings.applications.STATIC_BLUR) {
meta_window.bg_manager?._bms_pipeline?.effects.forEach(effect => {
if (effect.constructor.name === "CornerEffect")
effect.straight_corners = use_0_radius;
})
} else {
if (meta_window.bg_manager?._bms_pipeline?.effect)
meta_window.bg_manager._bms_pipeline.effect.corner_radius = use_0_radius ?
0 : this.settings.applications.CORNER_RADIUS;
}
}
/// Update all corners, to use when the setting has been changed.
update_all_corner_radii() {
this.meta_window_map.forEach(
(meta_window, _pid) => this.update_corner_radius(meta_window)
)
}
/// Set the opacity of the window actor that sits on top of the blur effect.
set_window_opacity(window_actor, opacity) {
window_actor?.get_children().forEach(child => {

View File

@ -63,11 +63,34 @@ export const PanelBlur = class PanelBlur {
// the blur when a window is near a panel
this.connect_to_windows_and_overview();
// connect to workareas change
this.connections.connect(global.display, 'workareas-changed',
_ => this.reset()
// connect to monitors change, and set a dirty flag to tell the extension that it should be
// reset on 'workareas-changed' signal
this._dirty = false;
this.connections.connect(Main.layoutManager, 'monitors-changed',
_ => this._dirty = true
);
this.connections.connect(global.display, 'workareas-changed', _ => {
if (this._dirty) {
// the monitors chaned
this.reset();
this._dirty = false;
}
else {
// blur panels created by extension multi-monitors-bar@frederykabryan
// I would like to connect directly to Main.uiGroup 'child-added' but it seems
// like the name is updated too late...
Main.uiGroup.get_children().forEach(child => {
if (child.get_name() === "panelBox" &&
child != Main.layoutManager.panelBox &&
child.get_n_children() == 1
) {
this.maybe_blur_panel(child.get_child_at_index(0));
}
});
}
})
this.enabled = true;
}
@ -95,8 +118,18 @@ export const PanelBlur = class PanelBlur {
if (this.settings.dash_to_panel.BLUR_ORIGINAL_PANEL && isMainPanelAlive)
this.maybe_blur_panel(Main.panel);
} else {
// if no dash-to-panel, blur the main and only panel
this.maybe_blur_panel(Main.panel);
// if no dash-to-panel, blur the main panel
if (isMainPanelAlive)
this.maybe_blur_panel(Main.panel);
// blur panels already created by extension multi-monitors-bar@frederykabryan
Main.uiGroup.get_children().forEach(actor => {
if (actor.get_name() === "panelBox" && actor.get_n_children() === 1) {
let multi_monitor_panel = actor.get_child_at_index(0);
if (isMainPanelAlive && multi_monitor_panel != Main.panel)
this.maybe_blur_panel(multi_monitor_panel);
}
})
}
}
@ -385,10 +418,8 @@ export const PanelBlur = class PanelBlur {
/// Update the css classname of the panel for light theme
update_light_text_classname(disable = false) {
if (!isMainPanelAlive) {
this._log("cannot update light text classname, Main.panel is not alive");
if (!isMainPanelAlive)
return;
}
if (this.settings.panel.FORCE_LIGHT_TEXT && !disable)
Main.panel.add_style_class_name("panel-light-text");
@ -561,6 +592,8 @@ export const PanelBlur = class PanelBlur {
immutable_actors_list.forEach(actors => this.destroy_blur(actors, false));
this.actors_list = [];
this._dirty = true;
this.connections.disconnect_all();
this.enabled = false;

View File

@ -43,6 +43,7 @@ export const DummyPipeline = class DummyPipeline {
this.build_effect({
unscaled_radius: 2 * this.settings.SIGMA,
brightness: this.settings.BRIGHTNESS,
corner_radius: this.settings.CORNER_RADIUS,
});
this.actor_destroy_id = this.actor.connect(
@ -75,6 +76,9 @@ export const DummyPipeline = class DummyPipeline {
this._brightness_changed_id = this.settings.settings.connect(
'changed::brightness', () => this.effect.brightness = this.settings.BRIGHTNESS
);
this._corner_radius_changed_id = this.settings.settings.connect(
'changed::corner-radius', () => this.effect.corner_radius = this.settings.CORNER_RADIUS
);
}
repaint_effect() {
@ -92,8 +96,11 @@ export const DummyPipeline = class DummyPipeline {
this.settings.settings.disconnect(this._sigma_changed_id);
if (this._brightness_changed_id)
this.settings.settings.disconnect(this._brightness_changed_id);
if (this._corner_radius_changed_id)
this.settings.settings.disconnect(this._corner_radius_changed_id);
delete this._sigma_changed_id;
delete this._brightness_changed_id;
delete this._corner_radius_changed_id;
}
/// Do nothing for this dummy pipeline.
@ -109,4 +116,4 @@ export const DummyPipeline = class DummyPipeline {
_warn(str) {
console.warn(`[Blur my Shell > dummy pip] ${str}`);
}
};
};

View File

@ -6,6 +6,7 @@ export const KEYS = [
component: "general", schemas: [
{ type: Type.PIPELINES, name: "pipelines" },
{ type: Type.I, name: "hacks-level" },
{ type: Type.B, name: "rounded-blur-found" },
{ type: Type.B, name: "debug" },
]
},
@ -31,6 +32,7 @@ export const KEYS = [
{ type: Type.S, name: "pipeline" },
{ type: Type.I, name: "sigma" },
{ type: Type.D, name: "brightness" },
{ type: Type.I, name: "corner-radius" },
{ type: Type.B, name: "unblur-in-overview" },
{ type: Type.B, name: "force-light-text" },
{ type: Type.B, name: "override-background" },
@ -45,6 +47,7 @@ export const KEYS = [
{ type: Type.S, name: "pipeline" },
{ type: Type.I, name: "sigma" },
{ type: Type.D, name: "brightness" },
{ type: Type.I, name: "corner-radius" },
{ type: Type.B, name: "unblur-in-overview" },
{ type: Type.B, name: "override-background" },
{ type: Type.I, name: "style-dash-to-dock" },
@ -57,6 +60,8 @@ export const KEYS = [
{ type: Type.S, name: "pipeline" },
{ type: Type.I, name: "sigma" },
{ type: Type.D, name: "brightness" },
{ type: Type.I, name: "corner-radius" },
{ type: Type.B, name: "corner-when-maximized" },
{ type: Type.I, name: "opacity" },
{ type: Type.B, name: "dynamic-opacity" },
{ type: Type.B, name: "blur-on-overview" },
@ -187,4 +192,4 @@ export const DEPRECATED_KEYS = [
{ type: Type.D, name: "noise-lightness" },
]
},
];
];

View File

@ -29,6 +29,7 @@ export function update_from_old_settings(gsettings) {
if (!deprecated_component.CUSTOMIZE) {
new_component.SIGMA = deprecated_preferences.SIGMA;
new_component.BRIGHTNESS = deprecated_preferences.BRIGHTNESS;
new_component.CORNER_RADIUS = deprecated_preferences.CORNER_RADIUS;
}
});
@ -37,4 +38,4 @@ export function update_from_old_settings(gsettings) {
}
preferences.settings.set_int('settings-version', CURRENT_SETTINGS_VERSION);
}
}

View File

@ -9,7 +9,11 @@ export const IS_IN_PREFERENCES = typeof global === 'undefined';
export async function import_in_shell_only(module) {
if (IS_IN_PREFERENCES)
return null;
return (await import(module)).default;
try {
return (await import(module)).default;
} catch (e) {
return null;
}
}
// In use for the effects, to prevent boilerplate code

View File

@ -7,6 +7,7 @@ uniform float width;
uniform float height;
uniform bool corners_top;
uniform bool corners_bottom;
uniform bool straight_corners;
uniform float clip_x0;
uniform float clip_y0;
@ -65,7 +66,9 @@ float rounded_rect_coverage(vec2 p, vec4 bounds, float clip_radius) {
float center_top = bounds.y + clip_radius;
float center_bottom = bounds.w - clip_radius;
if (corners_top && p.y < center_top)
if (straight_corners)
return 1.0;
else if (corners_top && p.y < center_top)
center.y = center_top + 2.;
else if (corners_bottom && p.y > center_bottom)
center.y = center_bottom - 1.;

View File

@ -77,6 +77,7 @@ export const CornerEffect = utils.IS_IN_PREFERENCES ?
this._clip_height = null;
utils.setup_params(this, params);
this.straight_corners = false;
// set shader source
this._source = utils.get_shader_source(Shell, SHADER_FILENAME, import.meta.url);
@ -165,6 +166,18 @@ export const CornerEffect = utils.IS_IN_PREFERENCES ?
}
}
get straight_corners() {
return this._straight_corners;
}
set straight_corners(value) {
if (this._straight_corners !== value) {
this._straight_corners = value;
this.set_uniform_value('straight_corners', this._straight_corners ? 1 : 0);
}
}
get clip() {
return [this._clip_x0, this._clip_y0, this._clip_width, this._clip_height];
}

View File

@ -11,6 +11,7 @@ import { PixelizeEffect } from './pixelize.js';
import { DerivativeEffect } from './derivative.js';
import { RgbToHslEffect } from './rgb_to_hsl.js';
import { HslToRgbEffect } from './hsl_to_rgb.js';
import { LuminosityEffect } from './luminosity.js';
// We do in this way because I've not found another way to store our preferences in a dictionnary
// while calling `gettext` on it while in preferences. Not so pretty, but works.
@ -33,6 +34,7 @@ export function get_effects_groups(_ = _ => "") {
"derivative",
"noise",
"color",
"luminosity",
"rgb_to_hsl",
"hsl_to_rgb"
]
@ -167,7 +169,8 @@ export function get_supported_effects(_ = () => "") {
color: {
name: _("Color"),
description: _("The color to blend in. The blending amount is controled by the opacity of the color."),
type: "rgba"
type: "rgba",
use_alpha: true
},
blend_mode: {
name: _("Blend mode"),
@ -197,6 +200,65 @@ export function get_supported_effects(_ = () => "") {
}
},
luminosity: {
class: LuminosityEffect,
name: _("Luminosity"),
description: _("An effect that affects the luminosity of the image."),
is_advanced: false,
editable_params: {
brightness_shift: {
name: _("Shift brightness"),
description: _("The brightness to add of remove to the image."),
type: "float",
min: -1.,
max: 1.,
increment: 0.01,
big_increment: 0.1,
digits: 2
},
brightness_multiplicator: {
name: _("Multiply brightness"),
description: _("The brightness multiplicator of the image, so that 0 means no brightness and 2 means infinite brightness."),
type: "float",
min: 0.,
max: 2.,
increment: 0.01,
big_increment: 0.1,
digits: 2
},
contrast: {
name: _("Contrast"),
description: _("The contrast of the image in regard to the center of the contrast."),
type: "float",
min: 0.,
max: 2.,
increment: 0.01,
big_increment: 0.1,
digits: 2
},
contrast_center: {
name: _("Contrast center"),
description: _("The center of the contrast to use."),
type: "float",
min: 0.,
max: 1.,
increment: 0.01,
big_increment: 0.1,
digits: 2
},
saturation_multiplicator: {
name: _("Saturation"),
description: _("The saturation of the image, so that 0 means no saturation and 2 means infinite saturation."),
type: "float",
min: 0.,
max: 2.,
increment: 0.01,
big_increment: 0.1,
digits: 2
},
}
},
pixelize: {
class: PixelizeEffect,
name: _("Pixelize"),
@ -343,7 +405,7 @@ export function get_supported_effects(_ = () => "") {
description: _("The radius of the corner. GNOME apps use a radius of 12 px by default."),
type: "integer",
min: 0,
max: 50,
max: 150,
increment: 1,
},
corners_top: {

View File

@ -0,0 +1,33 @@
uniform sampler2D tex;
uniform float brightness_shift;
uniform float brightness_multiplicator;
uniform float contrast;
uniform float contrast_center;
uniform float saturation_multiplicator;
vec3 hsl_to_rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
vec3 rgb_to_hsl(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
void main() {
vec4 c = texture2D(tex, cogl_tex_coord_in[0].st);
vec3 pix_hsl = rgb_to_hsl(c.xyz) / c.a;
pix_hsl.z = clamp(pix_hsl.z * brightness_multiplicator, 0., 1.);
pix_hsl.z = clamp((pix_hsl.z - contrast_center) * contrast + contrast_center + brightness_shift, 0., 1.);
pix_hsl.y = clamp(pix_hsl.y * saturation_multiplicator, 0., 1.);
cogl_color_out = vec4(hsl_to_rgb(pix_hsl) * c.a, c.a);
}

View File

@ -0,0 +1,141 @@
import GObject from 'gi://GObject';
import * as utils from '../conveniences/utils.js';
const Shell = await utils.import_in_shell_only('gi://Shell');
const Clutter = await utils.import_in_shell_only('gi://Clutter');
const SHADER_FILENAME = 'luminosity.glsl';
const DEFAULT_PARAMS = {
brightness_shift: 0., brightness_multiplicator: 1., contrast: 1., contrast_center: 0.5, saturation_multiplicator: 1.
};
export const LuminosityEffect = utils.IS_IN_PREFERENCES ?
{ default_params: DEFAULT_PARAMS } :
new GObject.registerClass({
GTypeName: "LuminosityEffect",
Properties: {
'brightness_shift': GObject.ParamSpec.double(
`brightness_shift`,
`Brightness shift`,
`Brightness shift value in shader`,
GObject.ParamFlags.READWRITE,
-1.0, 1.0,
0.0,
),
'brightness_multiplicator': GObject.ParamSpec.double(
`brightness_multiplicator`,
`Brightness multiplicator`,
`Brightness multiplicator value in shader`,
GObject.ParamFlags.READWRITE,
0.0, 2.0,
1.0,
),
'contrast': GObject.ParamSpec.double(
`contrast`,
`Contrast`,
`Contrast value in shader`,
GObject.ParamFlags.READWRITE,
0.0, 2.0,
1.0,
),
'contrast_center': GObject.ParamSpec.double(
`contrast_center`,
`Contrast center`,
`Contrast center value in shader`,
GObject.ParamFlags.READWRITE,
0.0, 1.0,
0.5,
),
'saturation_multiplicator': GObject.ParamSpec.double(
`saturation_multiplicator`,
`Saturation multiplicator`,
`Saturation multiplicator value in shader`,
GObject.ParamFlags.READWRITE,
0.0, 2.0,
1.0,
),
}
}, class LuminosityEffect extends Clutter.ShaderEffect {
constructor(params) {
super(params);
utils.setup_params(this, params);
// set shader source
this._source = utils.get_shader_source(Shell, SHADER_FILENAME, import.meta.url);
if (this._source)
this.set_shader_source(this._source);
}
static get default_params() {
return DEFAULT_PARAMS;
}
get brightness_shift() {
return this._brightness;
}
set brightness_shift(value) {
if (this._brightness_shift !== value) {
this._brightness_shift = value;
this.set_uniform_value('brightness_shift', parseFloat(this._brightness_shift - 1e-6));
}
}
get brightness_multiplicator() {
return this._brightness_multiplicator;
}
set brightness_multiplicator(value) {
if (this._brightness_multiplicator !== value) {
this._brightness_multiplicator = value;
let brightness_mul = 600.;
if (value < 1.995)
brightness_mul = 3. * (1. / (1. - (value / 2.) ** 2) - 1.);
this.set_uniform_value('brightness_multiplicator', parseFloat(brightness_mul - 1e-6));
}
}
get contrast() {
return this._contrast;
}
set contrast(value) {
if (this._contrast !== value) {
this._contrast = value;
this.set_uniform_value('contrast', parseFloat(this._contrast - 1e-6));
}
}
get contrast_center() {
return this._contrast_center;
}
set contrast_center(value) {
if (this._contrast_center !== value) {
this._contrast_center = value;
this.set_uniform_value('contrast_center', parseFloat(this._contrast_center - 1e-6));
}
}
get saturation_multiplicator() {
return this._saturation_multiplicator;
}
set saturation_multiplicator(value) {
if (this._saturation_multiplicator !== value) {
this._saturation_multiplicator = value;
let saturation_mul = 600.;
if (value < 1.995)
saturation_mul = 3. * (1. / (1. - (value / 2.) ** 2) - 1.);
this.set_uniform_value('saturation_multiplicator', parseFloat(saturation_mul - 1e-6));
}
}
});

View File

@ -35,14 +35,14 @@ void main() {
dir = vec2(cos(rv.y), sin(rv.y));
new_uv = uv + rv.x * dir * p;
if (new_uv.x > 2. / width && new_uv.y > 2. / height && new_uv.x < 1. - 3. / width && new_uv.y < 1. - 3. / height) {
strength = prefer_closer_pixels ? (iterations - i)^2 : 1;
strength = prefer_closer_pixels ? ((iterations - i) * (iterations - i)) : 1;
c += strength * texture2D(tex, new_uv);
count += strength;
}
}
if (count == 0 || use_base_pixel) {
strength = prefer_closer_pixels ? (iterations + 1)^2 : 1;
strength = prefer_closer_pixels ? ((iterations + 1) * (iterations + 1)) : 1;
c += strength * texture2D(tex, uv);
count += strength;
}

View File

@ -2,10 +2,17 @@ import GObject from 'gi://GObject';
import * as utils from '../conveniences/utils.js';
const St = await utils.import_in_shell_only('gi://St');
const Shell = await utils.import_in_shell_only('gi://Shell');
let BlurOrShell = await utils.import_in_shell_only('gi://Blur');
let IS_BLUR_MODULE = true;
if (BlurOrShell === null) {
BlurOrShell = await utils.import_in_shell_only('gi://Shell');
IS_BLUR_MODULE = false;
}
const DEFAULT_PARAMS = {
unscaled_radius: 30, brightness: 0.6
unscaled_radius: 30, brightness: 0.6, corner_radius: 14
};
@ -13,15 +20,21 @@ export const NativeDynamicBlurEffect = utils.IS_IN_PREFERENCES ?
{ default_params: DEFAULT_PARAMS } :
new GObject.registerClass({
GTypeName: "NativeDynamicBlurEffect"
}, class NativeDynamicBlurEffect extends Shell.BlurEffect {
}, class NativeDynamicBlurEffect extends BlurOrShell.BlurEffect {
constructor(params) {
const { unscaled_radius, brightness, ...parent_params } = params;
super({ ...parent_params, mode: Shell.BlurMode.BACKGROUND });
const { unscaled_radius, brightness, corner_radius, ...parent_params } = params;
if (IS_BLUR_MODULE)
super({ ...parent_params, mode: BlurOrShell.BlurMode.BACKGROUND, ...{ 'corner_radius': corner_radius } });
else
super({ ...parent_params, mode: BlurOrShell.BlurMode.BACKGROUND });
this._theme_context = St.ThemeContext.get_for_stage(global.stage);
this._theme_context.connectObject(
'notify::scale-factor',
_ => this.radius = this.unscaled_radius * this._theme_context.scale_factor,
_ => {
this.radius = this.unscaled_radius * this._theme_context.scale_factor;
this.corner_radius = this.unscaled_corner_radius * this._theme_context.scale_factor;
},
this
);
@ -40,4 +53,13 @@ export const NativeDynamicBlurEffect = utils.IS_IN_PREFERENCES ?
this._unscaled_radius = value;
this.radius = value * this._theme_context.scale_factor;
}
});
get unscaled_corner_radius() {
return this._unscaled_corner_radius;
}
set unscaled_corner_radius(value) {
this._unscaled_corner_radius = value;
this.corner_radius = value * this._theme_context.scale_factor;
}
});

View File

@ -6,6 +6,7 @@ import * as Config from 'resource:///org/gnome/shell/misc/config.js';
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
import { update_from_old_settings } from './conveniences/settings_updater.js';
import { import_in_shell_only} from './conveniences/utils.js';
import { PipelinesManager } from './conveniences/pipelines_manager.js';
import { EffectsManager } from './conveniences/effects_manager.js';
import { Connections } from './conveniences/connections.js';
@ -22,6 +23,8 @@ import { CoverflowAltTabBlur } from './components/coverflow_alt_tab.js';
import { ApplicationsBlur } from './components/applications.js';
import { ScreenshotBlur } from './components/screenshot.js';
const BlurModule = await import_in_shell_only('gi://Blur');
/// The main extension class, created when the GNOME Shell is loaded.
export default class BlurMyShell extends Extension {
@ -80,6 +83,9 @@ export default class BlurMyShell extends Extension {
if (this._settings.lockscreen.BLUR && !this._lockscreen_blur.enabled)
this._lockscreen_blur.enable();
// update whether or not the external rounded corners library was found
this._update_rounded_blur_found();
// ensure we take the correct action for the current session mode
this._user_session_mode_enabled = false;
this._on_session_mode_changed(Main.sessionMode);
@ -241,6 +247,19 @@ export default class BlurMyShell extends Extension {
}
}
/// Verify whether or not the gi://Blur library was found, in order to inform
/// the preferences and instruct the user to install it to have native rounded
/// corners in dynamic blur.
_update_rounded_blur_found() {
if (BlurModule === null) {
this._settings.ROUNDED_BLUR_FOUND = false;
this._log("using original implementation for the native blur effect")
} else {
this._settings.ROUNDED_BLUR_FOUND = true;
this._log("using external library for the native blur effect")
}
}
/// Add or remove the clutter debug flag to disable clipped redraws.
/// This will entirely fix the blur effect, but should not be used except if
/// the user really needs it, as clipped redraws are a huge performance
@ -488,6 +507,12 @@ export default class BlurMyShell extends Extension {
this._applications_blur.change_pipeline();
});
// rounded corners on maximized windows changed
this._settings.applications.CORNER_WHEN_MAXIMIZED_changed(() => {
if (this._settings.applications.BLUR)
this._applications_blur.update_all_corner_radii();
});
// application opacity changed
this._settings.applications.OPACITY_changed(() => {
if (this._settings.applications.BLUR)

View File

@ -24,5 +24,5 @@
],
"url": "https://github.com/aunetx/blur-my-shell",
"uuid": "blur-my-shell@aunetx",
"version": 71
"version": 72
}

View File

@ -37,6 +37,11 @@ export const Applications = GObject.registerClass({
'sigma',
'brightness_row',
'brightness',
'corner_radius_not_found_row',
'corner_radius_row',
'corner_radius',
'corner_when_maximized_row',
'corner_when_maximized',
'opacity',
'dynamic_opacity',
'blur_on_overview',
@ -97,6 +102,14 @@ export const Applications = GObject.registerClass({
'brightness', this._brightness, 'value',
Gio.SettingsBindFlags.DEFAULT
);
this.preferences.applications.settings.bind(
'corner-radius', this._corner_radius, 'value',
Gio.SettingsBindFlags.DEFAULT
);
this.preferences.applications.settings.bind(
'corner-when-maximized', this._corner_when_maximized, 'active',
Gio.SettingsBindFlags.DEFAULT
);
// connect 'enable all' button to whitelist/blacklist visibility
this._enable_all.bind_property(
@ -213,5 +226,9 @@ export const Applications = GObject.registerClass({
this._pipeline_choose_row.set_visible(is_static_blur);
this._sigma_row.set_visible(!is_static_blur);
this._brightness_row.set_visible(!is_static_blur);
this._corner_radius_row.set_visible(!is_static_blur);
this._corner_radius_row.set_visible(!is_static_blur && this.preferences.ROUNDED_BLUR_FOUND);
//this._corner_when_maximized_row.set_visible(!is_static_blur && this.preferences.ROUNDED_BLUR_FOUND);
this._corner_radius_not_found_row.set_visible(!is_static_blur && !this.preferences.ROUNDED_BLUR_FOUND);
}
});
});

View File

@ -16,6 +16,9 @@ export const Dash = GObject.registerClass({
'sigma',
'brightness_row',
'brightness',
'corner_radius_not_found_row',
'corner_radius_row',
'corner_radius',
'override_background',
'style_dash_to_dock',
'unblur_in_overview'
@ -54,6 +57,10 @@ export const Dash = GObject.registerClass({
'brightness', this._brightness, 'value',
Gio.SettingsBindFlags.DEFAULT
);
this.preferences.dash_to_dock.settings.bind(
'corner-radius', this._corner_radius, 'value',
Gio.SettingsBindFlags.DEFAULT
);
this.preferences.dash_to_dock.settings.bind(
'override-background',
this._override_background, 'enable-expansion',
@ -77,5 +84,7 @@ export const Dash = GObject.registerClass({
this._pipeline_choose_row.set_visible(is_static_blur);
this._sigma_row.set_visible(!is_static_blur);
this._brightness_row.set_visible(!is_static_blur);
this._corner_radius_row.set_visible(!is_static_blur && this.preferences.ROUNDED_BLUR_FOUND);
this._corner_radius_not_found_row.set_visible(!is_static_blur && !this.preferences.ROUNDED_BLUR_FOUND);
}
});
});

View File

@ -16,6 +16,9 @@ export const Panel = GObject.registerClass({
'sigma',
'brightness_row',
'brightness',
'corner_radius_not_found_row',
'corner_radius_row',
'corner_radius',
'unblur_in_overview',
'force_light_text',
'override_background',
@ -58,6 +61,10 @@ export const Panel = GObject.registerClass({
'brightness', this._brightness, 'value',
Gio.SettingsBindFlags.DEFAULT
);
this.preferences.panel.settings.bind(
'corner-radius', this._corner_radius, 'value',
Gio.SettingsBindFlags.DEFAULT
);
this.preferences.panel.settings.bind(
'unblur-in-overview', this._unblur_in_overview, 'active',
Gio.SettingsBindFlags.DEFAULT
@ -98,5 +105,7 @@ export const Panel = GObject.registerClass({
this._pipeline_choose_row.set_visible(is_static_blur);
this._sigma_row.set_visible(!is_static_blur);
this._brightness_row.set_visible(!is_static_blur);
this._corner_radius_row.set_visible(!is_static_blur && this.preferences.ROUNDED_BLUR_FOUND);
this._corner_radius_not_found_row.set_visible(!is_static_blur && !this.preferences.ROUNDED_BLUR_FOUND);
}
});
});

View File

@ -154,18 +154,24 @@ export const EffectRow = GObject.registerClass({
width_request: 75,
height_request: 45,
show_editor: true,
use_alpha: true
use_alpha: param.use_alpha
});
row.add_suffix(color_button);
// set original color
let c = color_button.get_rgba().copy();
[c.red, c.green, c.blue, c.alpha] = this.get_effect_param(param_key);
if (param.use_alpha)
[c.red, c.green, c.blue, c.alpha] = this.get_effect_param(param_key);
else
[c.red, c.green, c.blue] = this.get_effect_param(param_key);
color_button.set_rgba(c);
// update on on 'color-set'
color_button.connect(
'color-set', () => {
let c = color_button.get_rgba();
this.set_effect_param(param_key, [c.red, c.green, c.blue, c.alpha]);
if (param.use_alpha)
this.set_effect_param(param_key, [c.red, c.green, c.blue, c.alpha]);
else
this.set_effect_param(param_key, [c.red, c.green, c.blue]);
}
);
break;

View File

@ -1,5 +1,6 @@
import Gdk from 'gi://Gdk';
import Gtk from 'gi://Gtk';
import Gio from 'gi://Gio';
import { ExtensionPreferences } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
import { update_from_old_settings } from './conveniences/settings_updater.js';
@ -34,6 +35,17 @@ export default class BlurMyShellPreferences extends ExtensionPreferences {
// update from old settings, very important for hacks level specifically
update_from_old_settings(this.getSettings());
const actionGroup = new Gio.SimpleActionGroup();
window.insert_action_group('link', actionGroup);
const action = new Gio.SimpleAction({ name: 'open-gnome-rounded-blur' });
action.connect('activate', () => {
Gio.AppInfo.launch_default_for_uri(
'https://github.com/aunetx/blur-my-shell/blob/master/scripts/GUIDE.md',
null
);
});
actionGroup.add_action(action);
const preferences = new Settings(KEYS, this.getSettings());
const pipelines_manager = new PipelinesManager(preferences);

View File

@ -84,6 +84,11 @@
<default>1</default>
<summary>Level of hacks to use (from 0 to 2, 2 disabling clipped redraws entirely)</summary>
</key>
<!-- ROUNDED BLUR FOUND -->
<key type="b" name="rounded-blur-found">
<default>false</default>
<summary>Boolean, set to true if a patched version of ShellBlurEffect was found</summary>
</key>
<!-- DEBUG -->
<key type="b" name="debug">
<default>false</default>
@ -226,6 +231,11 @@
<default>0.6</default>
<summary>Brightness to use for the blur effect</summary>
</key>
<!-- CORNER RADIUS -->
<key type="i" name="corner-radius">
<default>0</default>
<summary>Radius for the corner rounding effect</summary>
</key>
<!-- COLOR -->
<key type="(dddd)" name="color">
<default>(0.,0.,0.,0.)</default>
@ -338,7 +348,7 @@
</key>
<!-- CORNER RADIUS -->
<key type="i" name="corner-radius">
<default>12</default>
<default>18</default>
<summary>Radius for the corner rounding effect</summary>
</key>
</schema>
@ -376,6 +386,16 @@
<default>1.</default>
<summary>Brightness to use for the blur effect</summary>
</key>
<!-- CORNER RADIUS -->
<key type="i" name="corner-radius">
<default>15</default>
<summary>Radius for the corner rounding effect</summary>
</key>
<!-- CORNER WHEN MAXIMIZED -->
<key type="b" name="corner-when-maximized">
<default>false</default>
<summary>Boolean, whether to keep rounding the corners of fullscreen and maximized window or not</summary>
</key>
<!-- COLOR -->
<key type="(dddd)" name="color">
<default>(0.,0.,0.,0.)</default>
@ -592,4 +612,4 @@
<summary>Boolean, whether to blur the original panel (if option selected) with Dash to Panel</summary>
</key>
</schema>
</schemalist>
</schemalist>

View File

@ -109,6 +109,47 @@ To get the best results possible, although with reduced performances, you can ch
</object>
</child>
<child>
<object class="AdwActionRow" id="corner_radius_not_found_row">
<property name="title" translatable="yes">Corner radius</property>
<property name="subtitle" translatable="yes">In order to use rounded corners, please install the GNOME Rounded Blur library.</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
<property name="activatable-widget">open_gnome_rounded_blur</property>
<child type="suffix">
<object class="GtkButton" id="open_gnome_rounded_blur">
<property name="icon-name">external-link-symbolic</property>
<property name="valign">center</property>
<property name="action-name">link.open-gnome-rounded-blur</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwSpinRow" id="corner_radius_row">
<property name="title" translatable="yes">Corner radius</property>
<property name="subtitle" translatable="yes">Radius for the corner rounding effect.</property>
<property name="adjustment">corner_radius</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
</object>
</child>
<child>
<object class="AdwActionRow" id="corner_when_maximized_row">
<property name="title" translatable="yes">Enable corner rounding on maximized and fullscreen</property>
<property name="subtitle" translatable="yes">Corner rounding effect will keep being applied to maximized and fullscreen windows.</property>
<property name="activatable-widget">corner_when_maximized</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
<child>
<object class="GtkSwitch" id="corner_when_maximized">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Opacity</property>
@ -268,6 +309,12 @@ Use * to match any sequence of characters (e.g., Firefox* or *Code*), and ? for
<property name="step-increment">0.01</property>
</object>
<object class="GtkAdjustment" id="corner_radius">
<property name="lower">0</property>
<property name="upper">150</property>
<property name="step-increment">1</property>
</object>
<object class="GtkAdjustment" id="opacity">
<property name="lower">25</property>
<property name="upper">255</property>

View File

@ -108,6 +108,32 @@
</object>
</child>
<child>
<object class="AdwActionRow" id="corner_radius_not_found_row">
<property name="title" translatable="yes">Corner radius</property>
<property name="subtitle" translatable="yes">In order to use rounded corners, please install the GNOME Rounded Blur library.</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
<property name="activatable-widget">open_gnome_rounded_blur</property>
<child type="suffix">
<object class="GtkButton" id="open_gnome_rounded_blur">
<property name="icon-name">external-link-symbolic</property>
<property name="valign">center</property>
<property name="action-name">link.open-gnome-rounded-blur</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwSpinRow" id="corner_radius_row">
<property name="title" translatable="yes">Corner radius</property>
<property name="subtitle" translatable="yes">Radius for the corner rounding effect.</property>
<property name="adjustment">corner_radius</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
</object>
</child>
<child>
<object class="AdwExpanderRow" id="override_background">
<property name="title" translatable="yes">Override background</property>
@ -161,6 +187,12 @@
<property name="upper">1.0</property>
<property name="step-increment">0.01</property>
</object>
<object class="GtkAdjustment" id="corner_radius">
<property name="lower">0</property>
<property name="upper">150</property>
<property name="step-increment">1</property>
</object>
<object class="GtkStringList" id="style_dash_to_dock_model">
<items>
@ -169,4 +201,4 @@
<item translatable="yes">Dark</item>
</items>
</object>
</interface>
</interface>

View File

@ -62,6 +62,11 @@
</property>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="description">In order to have rounded corners on a component, add a “Corner” effect at the end of its pipeline.</property>
</object>
</child>
</object>
</child>
</template>

View File

@ -108,6 +108,32 @@
</object>
</child>
<child>
<object class="AdwActionRow" id="corner_radius_not_found_row">
<property name="title" translatable="yes">Corner radius</property>
<property name="subtitle" translatable="yes">In order to use rounded corners, please install the GNOME Rounded Blur library.</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
<property name="activatable-widget">open_gnome_rounded_blur</property>
<child type="suffix">
<object class="GtkButton" id="open_gnome_rounded_blur">
<property name="icon-name">external-link-symbolic</property>
<property name="valign">center</property>
<property name="action-name">link.open-gnome-rounded-blur</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwSpinRow" id="corner_radius_row">
<property name="title" translatable="yes">Corner radius</property>
<property name="subtitle" translatable="yes">Radius for the corner rounding effect.</property>
<property name="adjustment">corner_radius</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Force light text</property>
@ -237,4 +263,10 @@ Recommended unless you want to customize your GNOME theme.</property>
<property name="upper">1.0</property>
<property name="step-increment">0.01</property>
</object>
<object class="GtkAdjustment" id="corner_radius">
<property name="lower">0</property>
<property name="upper">150</property>
<property name="step-increment">1</property>
</object>
</interface>