[gnome] Update extensions

This commit is contained in:
2026-04-09 09:51:44 -04:00
parent dadc78f2f4
commit 505c67d292
61 changed files with 1729 additions and 365 deletions

View File

@ -16,6 +16,9 @@ const PANEL_STYLES = [
"contrasted-panel"
];
// global listener, so we don't miss the panel destruction event
let isMainPanelAlive = true;
Main.panel.connect('destroy', () => isMainPanelAlive = false);
export const PanelBlur = class PanelBlur {
constructor(connections, settings, effects_manager) {
@ -28,6 +31,11 @@ export const PanelBlur = class PanelBlur {
}
enable() {
if (this.enabled) {
this._log("blur already enabled");
return;
}
this._log("blurring top panel");
// check for panels when Dash to Panel is activated
@ -64,6 +72,11 @@ export const PanelBlur = class PanelBlur {
}
reset() {
if (!this.enabled) {
this._log("reset called but blur is not enabled");
return;
}
this._log("resetting...");
this.disable();
@ -77,6 +90,10 @@ export const PanelBlur = class PanelBlur {
// blur already existing ones
if (global.dashToPanel.panels)
this.blur_dtp_panels();
// blur main panel if requested in settings
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);
@ -92,24 +109,15 @@ export const PanelBlur = class PanelBlur {
if (!global.dashToPanel?.panels) {
return GLib.SOURCE_REMOVE;
}
this._log("Blurring Dash to Panel panels after idle.");
// blur every panel found
// blur every panel, except Main.panel (this is handled in blur_existing_panels() method above)
global.dashToPanel.panels.forEach(p => {
this.maybe_blur_panel(p.panel);
if (p.panel != Main.panel)
this.maybe_blur_panel(p.panel);
});
// if main panel is not included in the previous panels, blur it
if (
!global.dashToPanel.panels
.map(p => p.panel)
.includes(Main.panel)
&&
this.settings.dash_to_panel.BLUR_ORIGINAL_PANEL
)
this.maybe_blur_panel(Main.panel);
return GLib.SOURCE_REMOVE;
});
};
@ -377,6 +385,11 @@ 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");
return;
}
if (this.settings.panel.FORCE_LIGHT_TEXT && !disable)
Main.panel.add_style_class_name("panel-light-text");
else
@ -408,7 +421,7 @@ export const PanelBlur = class PanelBlur {
/// Update the visibility of the blur effect
update_visibility() {
if (
Main.panel.has_style_pseudo_class('overview')
isMainPanelAlive && Main.panel.has_style_pseudo_class('overview')
|| !Main.sessionMode.hasWindows
) {
this.actors_list.forEach(
@ -533,6 +546,11 @@ export const PanelBlur = class PanelBlur {
}
disable() {
if (!this.enabled) {
this._log("blur already removed");
return;
}
this._log("removing blur from top panel");
this.disconnect_from_windows_and_overview();