diff options
Diffstat (limited to 'raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/overview.js')
| -rw-r--r-- | raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/overview.js | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/overview.js b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/overview.js index 3bbde61..c97a459 100644 --- a/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/overview.js +++ b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/overview.js @@ -104,13 +104,39 @@ export const OverviewBlur = class OverviewBlur { // this hides windows that are not on the current workspace if ( outer_this.settings.applications.BLUR - ) + ) { + // compile blacklist patterns once for this switch + const blacklist = outer_this.settings.applications.BLACKLIST || []; + const blacklist_regexes = blacklist.map(pattern => { + const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&'); + return new RegExp('^' + escaped.replace(/\*/g, '.*').replace(/\?/g, '.') + '$', 'i'); + }); + for (let i = 0; i < w_m.get_n_workspaces(); i++) { if (i != w_m.get_active_workspace_index()) w_m.get_workspace_by_index(i)?.list_windows().forEach( - window => window.get_compositor_private().hide() + window => { + // skip windows on all workspaces (e.g. secondary + // monitor windows under `workspaces-only-on-primary`); + // hiding them on any inactive workspace hides them globally + if (window.is_on_all_workspaces()) return; + + // skip desktop-type windows (e.g. DING, Nautilus desktop): + // they should always remain visible + if (window.get_window_type() === Meta.WindowType.DESKTOP) + return; + + // skip blacklisted windows: + // they are not blurred and should always remain visible + const wm_class = window.get_wm_class(); + if (wm_class && blacklist_regexes.some(re => re.test(wm_class))) + return; + + window.get_compositor_private().hide(); + } ); } + } Main.uiGroup.remove_child(outer_this.animation_background_group); }; @@ -149,14 +175,11 @@ export const OverviewBlur = class OverviewBlur { // add the container widget for the overview only to the overview group Main.layoutManager.overviewGroup.insert_child_at_index(this.overview_background_group, 0); // make sure it stays below - let _reordering = false; this.connections.connect(Main.layoutManager.overviewGroup, "child-added", (_, child) => { - if (!_reordering && child !== this.overview_background_group) { - _reordering = true; + if (child !== this.overview_background_group) { if (this.overview_background_group.get_parent()) Main.layoutManager.overviewGroup.remove_child(this.overview_background_group); Main.layoutManager.overviewGroup.insert_child_at_index(this.overview_background_group, 0); - _reordering = false; } }); } |