summaryrefslogtreecommitdiff
path: root/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_transitions.js
diff options
context:
space:
mode:
authorNippy <nippy@Nippy-Mac-mini.local>2026-10-09 17:23:53 +0200
committerNippy <nippy@Nippy-Mac-mini.local>2026-10-09 17:23:53 +0200
commit9d5be1660d8f74038ebed3d74fdbc809e43787ae (patch)
tree4cb46c3765be87ca4c5219f2f714425d7dfddb56 /raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_transitions.js
parentdeb4b8a9c407832c35100a643bd7a592589c9679 (diff)
downloadRaveOS-PKGBUILD-9d5be1660d8f74038ebed3d74fdbc809e43787ae.tar.gz
RaveOS-PKGBUILD-9d5be1660d8f74038ebed3d74fdbc809e43787ae.zip
gnome fix
Diffstat (limited to 'raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_transitions.js')
-rw-r--r--raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_transitions.js139
1 files changed, 139 insertions, 0 deletions
diff --git a/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_transitions.js b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_transitions.js
new file mode 100644
index 0000000..70fd520
--- /dev/null
+++ b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_transitions.js
@@ -0,0 +1,139 @@
+const GEOMETRY_TRANSITION_PROPERTIES = [
+ 'x',
+ 'y',
+ 'width',
+ 'height',
+ 'clip-rect',
+ 'clip_rect',
+ 'translation-x',
+ 'translation-y',
+ 'translation_x',
+ 'translation_y',
+ 'scale-x',
+ 'scale-y',
+ 'scale_x',
+ 'scale_y',
+];
+
+export const PopupBlurSurfaceTransitions = class PopupBlurSurfaceTransitions {
+ constructor(surface) {
+ this.surface = surface;
+ }
+
+ has_running() {
+ return this.get_state().running;
+ }
+
+ get_state(include_descendants = false) {
+ const surface_actors = this.get_surface_actors();
+ const actors = include_descendants
+ ? this.get_actors(surface_actors)
+ : surface_actors;
+ const geometry_properties = this.get_running_properties(
+ GEOMETRY_TRANSITION_PROPERTIES,
+ actors
+ );
+ const opacity = this.has_running_for(['opacity'], surface_actors);
+
+ return {
+ complete: include_descendants,
+ running: opacity || geometry_properties.size > 0,
+ geometry: geometry_properties.size > 0,
+ geometry_properties,
+ opacity,
+ };
+ }
+
+ complete_state(transition_state) {
+ if (transition_state.complete)
+ return transition_state;
+
+ return this.get_state(true);
+ }
+
+ has_running_for(properties, actors) {
+ return actors.some(actor =>
+ properties.some(property => this.has_transition(actor, property))
+ );
+ }
+
+ get_running_properties(properties, actors) {
+ const running_properties = new Set();
+
+ actors.forEach(actor => {
+ properties.forEach(property => {
+ if (this.has_transition(actor, property))
+ running_properties.add(this.normalize_property(property));
+ });
+ });
+
+ return running_properties;
+ }
+
+ normalize_property(property) {
+ return property.replace(/_/g, '-');
+ }
+
+ get_actors(surface_actors = this.get_surface_actors()) {
+ const actors = [...surface_actors];
+ const seen = new WeakSet();
+ actors.forEach(actor => seen.add(actor));
+
+ if (!this.surface.is_quick_settings()) {
+ this.add_descendants(actors, seen, this.surface.target);
+ this.add_descendants(actors, seen, this.surface.root_actor);
+ }
+
+ return actors;
+ }
+
+ get_surface_actors() {
+ const actors = [];
+ const seen = new WeakSet();
+
+ this.add_actor(actors, seen, this.surface.target);
+ this.add_actor(actors, seen, this.surface.root_actor);
+ this.add_actor(actors, seen, this.surface.get_geometry_actor());
+ this.add_ancestors(actors, seen, this.surface.target);
+ this.add_ancestors(actors, seen, this.surface.root_actor);
+
+ return actors;
+ }
+
+ add_actor(actors, seen, actor) {
+ if (!actor || seen.has(actor))
+ return;
+
+ seen.add(actor);
+ actors.push(actor);
+ }
+
+ add_ancestors(actors, seen, actor) {
+ actor = actor?.get_parent();
+ while (actor && actor !== this.surface.parent) {
+ this.add_actor(actors, seen, actor);
+ actor = actor.get_parent();
+ }
+ }
+
+ add_descendants(actors, seen, actor) {
+ const stack = this.get_children(actor).slice().reverse();
+
+ while (stack.length > 0) {
+ const child = stack.pop();
+ if (seen.has(child))
+ continue;
+
+ this.add_actor(actors, seen, child);
+ stack.push(...this.get_children(child).slice().reverse());
+ }
+ }
+
+ has_transition(actor, property) {
+ return !!actor?.get_transition(property);
+ }
+
+ get_children(actor) {
+ return actor ? actor.get_children() : [];
+ }
+};