diff --git a/.clang-format b/.clang-format
index 7e68b37..07cf790 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,4 +1,6 @@
BasedOnStyle: Google
AlignConsecutiveAssignments: true
+AlignAfterOpenBracket: Align
+ContinuationIndentWidth: 2
KeepEmptyLinesAtTheStartOfBlocks: true
ColumnLimit: 90
\ No newline at end of file
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index e101616..77d9834 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -6,7 +6,7 @@ open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
+liberapay: # Schneegans
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.paypal.com/donate/?hosted_button_id=3F7UFL8KLVPXE']
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 85b8528..b849c90 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -17,14 +17,13 @@ Steps to reproduce the behavior:
4. See error
You may also check the output of GNOME Shell for any error messages.
-This can be done with the following terminal command:
+This can be done with the following terminal command.
+Execute this in a terminal and observe the output while reproducing the bug.
+```bash
journalctl -f -o cat | grep -E 'burn-my-windows|'
```
-## Expected Behavior
-A clear and concise description of what you expected to happen.
-
## System
_Please complete the following information:_
- Linux distribution [e.g. Ubuntu 21.04]
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index fcd10c7..425a5a3 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,16 +1,14 @@
---
-name: Feature Request
+name: General Feature Request
about: Suggest an idea for the Burn-My-Windows Extension.
title: ''
-labels: enhancement
+labels: 'feature request'
assignees: ''
---
-## The Motivation
-A clear and concise description of use-case.
-
-## The Solution
-A clear and concise description of what you want to happen.
+## The Idea
+A clear and concise description of your idea.
+If applicable, feel free to add screenshots or mock-ups to illustrate your idea!
## The Alternatives
-A clear and concise description of any alternative solutions or features you've considered.
+Are there alternative solutions or features you've considered?
diff --git a/.github/ISSUE_TEMPLATE/new_effect.md b/.github/ISSUE_TEMPLATE/new_effect.md
new file mode 100644
index 0000000..15fbfb9
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new_effect.md
@@ -0,0 +1,17 @@
+---
+name: New Effect
+about: Suggest a new effect for the Burn-My-Windows Extension.
+title: ''
+labels: 'new effect'
+assignees: ''
+---
+
+## The Idea
+Please describe your idea as detailed as possible.
+It would be great if you could add a drawing or any other kind of mock-up to illustrate your idea!
+
+## Window Closing vs. Window Opening
+Make sure to describe how the effect could be reversed, so how should a window disappear and how should it appear.
+
+## References
+It would be great if you could provide some video references (e.g. YouTube links) if your idea is based on something which - for example - exists in movies.
\ No newline at end of file
diff --git a/.github/workflows/badges.yml b/.github/workflows/badges.yml
new file mode 100644
index 0000000..7a43da6
--- /dev/null
+++ b/.github/workflows/badges.yml
@@ -0,0 +1,40 @@
+name: Badges
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ update-badges:
+ name: Update Badges
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v2
+ - name: Download cloc
+ run: sudo apt-get update -y && sudo apt-get install -y cloc
+ - name: Get the Numbers
+ run: |
+ echo "CODE_LINES=$(scripts/cloc.sh --loc)" >> $GITHUB_ENV
+ echo "COMMENT_LINES=$(scripts/cloc.sh --percentage)%" >> $GITHUB_ENV
+ - name: Create Lines-of-Code-Badge
+ uses: schneegans/dynamic-badges-action@v1.2.0
+ with:
+ auth: ${{ secrets.GIST_SECRET }}
+ gistID: 8cf45f23253ff09b21196e7271378762
+ filename: loc.json
+ label: Lines of Code
+ message: ${{ env.CODE_LINES }}
+ color: lightgrey
+ labelColor: 303030
+ - name: Create Comments-Badge
+ uses: schneegans/dynamic-badges-action@v1.2.0
+ with:
+ auth: ${{ secrets.GIST_SECRET }}
+ gistID: 8cf45f23253ff09b21196e7271378762
+ filename: comments.json
+ label: Comments
+ message: ${{ env.COMMENT_LINES }}
+ color: green
+ labelColor: 303030
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 022a327..71d9e76 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -76,7 +76,35 @@ jobs:
( contains(github.ref, 'main') && !contains(github.event.head_commit.message, '[no-ci]') ) ||
( contains(github.ref, 'develop') && !contains(github.event.head_commit.message, '[no-ci]') ) ||
contains(github.event.head_commit.message, '[run-ci]')
+ strategy:
+ fail-fast: false
+ matrix:
+ version:
+ - '32'
+ - '33'
+ - '34'
+ - '35'
+ - '36'
+ session:
+ - 'gnome-xsession'
+ - 'gnome-wayland-nested'
steps:
- uses: actions/checkout@v2
+ - name: Download Dependencies
+ run: |
+ sudo apt update -qq
+ sudo apt install gettext -qq
- name: Build Burn-My-Windows
run: make
+ - name: Test Burn-My-Windows
+ run: sudo $GITHUB_WORKSPACE/tests/run-test.sh -v ${{ matrix.version }} -s ${{ matrix.session }}
+ - uses: actions/upload-artifact@v2
+ if: failure()
+ with:
+ name: log_${{ matrix.version }}_${{ matrix.session }}
+ path: fail.log
+ - uses: actions/upload-artifact@v2
+ if: failure()
+ with:
+ name: screen_${{ matrix.version }}_${{ matrix.session }}
+ path: fail.png
\ No newline at end of file
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 3e1a74e..044375b 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -6,7 +6,7 @@ on:
- '**'
jobs:
- source_code:
+ extension_bundle:
name: Extension Bundle
runs-on: ubuntu-latest
steps:
@@ -20,10 +20,9 @@ jobs:
run: |
make zip
- name: Upload Release
- uses: svenstaro/upload-release-action@v1-release
+ uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: burn-my-windows@schneegans.github.com.zip
- asset_name: burn-my-windows@schneegans.github.com.zip
tag: ${{ github.ref }}
overwrite: true
diff --git a/.gitignore b/.gitignore
index 77585ec..11da693 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
*.blend1
*.blend2
*.blend3
+/locale
/schemas/gschemas.compiled
/resources/burn-my-windows.gresource
/resources/burn-my-windows.gresource.xml
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 6dc34d4..4931975 100644
--- a/Makefile
+++ b/Makefile
@@ -1,51 +1,111 @@
SHELL := /bin/bash
-JS_FILES = $(shell find -type f -and \( -name "*.js" \))
+# We define these here to make the makefile easier to port to another extension.
+NAME := burn-my-windows
+DOMAIN := schneegans.github.com
+ZIP_NAME := $(NAME)@$(DOMAIN).zip
+
+# Some of the recipes below depend on some of these files.
+JS_FILES = $(shell find -type f -and \( -name "*.js" \))
+UI_FILES = $(shell find -type f -and \( -name "*.ui" \))
RESOURCE_FILES = $(shell find resources -mindepth 2 -type f)
+LOCALES_PO = $(wildcard po/*.po)
+LOCALES_MO = $(patsubst po/%.po,locale/%/LC_MESSAGES/$(NAME).mo,$(LOCALES_PO))
-.PHONY: zip install uninstall clean
+# These files will be included in the extension zip file.
+ZIP_CONTENT = $(JS_FILES) $(LOCALES_MO) resources/$(NAME).gresource \
+ schemas/gschemas.compiled metadata.json LICENSE
-zip: burn-my-windows@schneegans.github.com.zip
+# These seven recipes can be invoked by the user.
+.PHONY: zip install uninstall pot clean test references
-install: burn-my-windows@schneegans.github.com.zip
- gnome-extensions install "burn-my-windows@schneegans.github.com.zip" --force
+# The zip recipes only bundles the extension without installing it.
+zip: $(ZIP_NAME)
+
+# The install recipes creates the extension zip and installs it.
+install: $(ZIP_NAME)
+ gnome-extensions install "$(ZIP_NAME)" --force
@echo "Extension installed successfully! Now restart the Shell ('Alt'+'F2', then 'r')."
+# This uninstalls the previously installed extension.
uninstall:
- gnome-extensions uninstall "burn-my-windows@schneegans.github.com"
+ gnome-extensions uninstall "$(NAME)@$(DOMAIN)"
+# Use gettext to generate a translation template file.
+pot: $(JS_FILES) $(UI_FILES)
+ @echo "Generating '$(NAME).pot'..."
+ @xgettext --from-code=UTF-8 \
+ --add-comments=Translators \
+ --copyright-holder="Simon Schneegans" \
+ --package-name="$(NAME)" \
+ --output=po/$(NAME).pot \
+ $(JS_FILES) $(UI_FILES)
+
+# This runs several tests in containerized versions of GNOME Shell.
+test:
+ @ for version in 32 33 34 35 36 ; do \
+ for session in "gnome-xsession" "gnome-wayland-nested" ; do \
+ echo ; \
+ echo "Running Tests on Fedora $$version ($$session)." ; \
+ echo ; \
+ ./tests/run-test.sh -s $$session -v $$version ; \
+ done \
+ done
+
+# This re-generates all reference images required by the tests.
+references:
+ @ for version in 32 33 34 35 36 ; do \
+ for session in "gnome-xsession" "gnome-wayland-nested" ; do \
+ echo ; \
+ echo "Generating References for Fedora $$version ($$session)." ; \
+ echo ; \
+ ./tests/generate-references.sh -s $$session -v $$version ; \
+ done \
+ done
+
+# This removes all temporary files created with the other recipes.
clean:
- rm -rf \
- burn-my-windows@schneegans.github.com.zip \
- resources/burn-my-windows.gresource \
- resources/burn-my-windows.gresource.xml \
- schemas/gschemas.compiled
+ rm -rf $(ZIP_NAME) \
+ resources/$(NAME).gresource \
+ resources/$(NAME).gresource.xml \
+ schemas/gschemas.compiled \
+ locale
-burn-my-windows@schneegans.github.com.zip: schemas/gschemas.compiled resources/burn-my-windows.gresource $(JS_FILES)
- @# Check if the VERSION variable was passed and set version to it
- @if [[ "$(VERSION)" != "" ]]; then \
- sed -i "s| \"version\":.*| \"version\": $(VERSION)|g" metadata.json; \
- fi
- @# TODO Maybe echo version number of the release that was built, in order to facilitate double-checking before publishing it?
-
+# This bundles the extension and checks whether it is small enough to be uploaded to
+# extensions.gnome.org. We do not use "gnome-extensions pack" for this, as this is not
+# readily available on the GitHub runners.
+$(ZIP_NAME): $(ZIP_CONTENT)
@echo "Packing zip file..."
- @rm --force burn-my-windows@schneegans.github.com.zip
- @zip -r burn-my-windows@schneegans.github.com.zip -- *.js src/*.js resources/burn-my-windows.gresource schemas/gschemas.compiled metadata.json LICENSE
-
+ @rm --force $(ZIP_NAME)
+ @zip $(ZIP_NAME) -- $(ZIP_CONTENT)
+
@#Check if the zip size is too big to be uploaded
- @if [[ "$$(stat -c %s burn-my-windows@schneegans.github.com.zip)" -gt 4096000 ]]; then \
- echo "ERROR! The extension is too big to be uploaded to the extensions website, keep it smaller than 4096 KB!"; exit 1; \
- fi
+ @SIZE=$$(unzip -Zt $(ZIP_NAME) | awk '{print $$3}') ; \
+ if [[ $$SIZE -gt 5242880 ]]; then \
+ echo "ERROR! The extension is too big to be uploaded to" \
+ "the extensions website, keep it smaller than 5 MB!"; \
+ exit 1; \
+ fi
-resources/burn-my-windows.gresource: resources/burn-my-windows.gresource.xml
+# Compiles the gschemas.compiled file from the gschema.xml file.
+schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.$(NAME).gschema.xml
+ @echo "Compiling schemas..."
+ @glib-compile-schemas schemas
+
+# Compiles the gresource file from the gresources.xml.
+resources/$(NAME).gresource: resources/$(NAME).gresource.xml
@echo "Compiling resources..."
- @glib-compile-resources --sourcedir="resources" --generate resources/burn-my-windows.gresource.xml
+ @glib-compile-resources --sourcedir="resources" --generate resources/$(NAME).gresource.xml
-resources/burn-my-windows.gresource.xml: $(RESOURCE_FILES)
+# Generates the gresources.xml based on all files in the resources subdirectory.
+resources/$(NAME).gresource.xml: $(RESOURCE_FILES)
@echo "Creating resources xml..."
@FILES=$$(find "resources" -mindepth 2 -type f -printf "%P\n" | xargs -i echo "{}") ; \
- echo " $$FILES " > resources/burn-my-windows.gresource.xml
+ echo " $$FILES " \
+ > resources/$(NAME).gresource.xml
-schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml
- @echo "Compiling schemas..."
- @glib-compile-schemas schemas
\ No newline at end of file
+# Compiles all *.po files to *.mo files.
+locale/%/LC_MESSAGES/$(NAME).mo: po/%.po
+ @echo "Compiling $@"
+ @mkdir -p locale/$*/LC_MESSAGES
+ @msgfmt -c -o $@ $<
diff --git a/README.md b/README.md
index 34dad0d..64d1be4 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,17 @@
-# 🔥 Set GNOME Shell on Fire!
+
+
+
+
🔥 Set GNOME Shell on Fire!
+
+
+
-
+
+
+
+
When I released the [Desktop Cube Extension](https://github.com/Schneegans/Desktop-Cube/), many people requested to revive one of the most useless features of Linux desktop history: Setting windows on fire!
This extension is not only more useless than the cube, but it is also much more hacky. So I expect some bug! [Let's incinerate them all](https://github.com/Schneegans/Burn-My-Windows/issues)!
@@ -25,7 +34,7 @@ Effect | Preview
## 💞 These People _love_ this Extension
-While coding new features is the most awesome way to contribute, providing financial support will help me stay motivated to invest my spare time to keep the project alive in the future.
+While [coding new features](docs/how-to-create-new-effects.md) or [translating the extension](https://hosted.weblate.org/engage/burn-my-windows/) are the most awesome ways to contribute, providing financial support will help me stay motivated to invest my spare time to keep the project alive in the future.
🥇 Current Gold Sponsors
@@ -34,17 +43,20 @@ While coding new features is the most awesome way to contribute, providing finan
+ @MrTomRod
+ Pouhiou
DAPREMONT Christophe @manero6 @RickStanley
@@ -116,7 +128,7 @@ gnome-extensions enable burn-my-windows@schneegans.github.com
## :octocat: I want to contribute!
That's great!
-Most likely, you want to [create a new effect](docs/how-to-create-new-effects.md)?
+Most likely, you want to [create a new effect](docs/how-to-create-new-effects.md) or to [translate the extension](https://hosted.weblate.org/engage/burn-my-windows/)?
Here are some basic rules to get you started:
Commits should start with a Capital letter and should be written in present tense (e.g. __:tada: Add cool new feature__ instead of __:tada: Added cool new feature__).
You should also start your commit message with **one** applicable emoji.
diff --git a/assets/bmw10.svg b/assets/bmw10.svg
new file mode 100644
index 0000000..d648b8f
--- /dev/null
+++ b/assets/bmw10.svg
@@ -0,0 +1,3795 @@
+
+
+
+
diff --git a/assets/teaser.svg b/assets/teaser.svg
new file mode 100644
index 0000000..779ce28
--- /dev/null
+++ b/assets/teaser.svg
@@ -0,0 +1,54986 @@
+
+
+
+
diff --git a/docs/changelog.md b/docs/changelog.md
index a8bd78d..195ffc5 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,18 +1,94 @@
# Changelog of the Burn-My-Windows Extension
-## [Burn My Window 10](https://github.com/schneegans/Burn-My-Windows/releases/tag/v10)
+## [Burn My Window 14](https://github.com/schneegans/Burn-My-Windows/releases/tag/v14)
-**Release Date:** TBD
+**Release Date:** 2022-03-29
+
+#### Enhancements
+
+* Reduced the lower animation time limits for all effects to 100 ms. This should now allow for very snappy animations!
+* A completely new Russian translation. Thank you, ANIGO R.!
+
+#### Bug Fixes
+
+* Fixed the version check for GNOME Shell `42.rc` (before it only worked on `42.alpha` and `42.beta`)
+
+
+## [Burn My Window 13](https://github.com/schneegans/Burn-My-Windows/releases/tag/v13)
+
+**Release Date:** 2022-03-27
+
+#### Enhancements
+
+* The continuous integration tests have been significantly enhanced. Now, all window-open and window-close animations are visually tested on all supported GNOME versions and on X11 / Wayland (summing up to a total of 136 test cases).
+* Many translation updates, including a completely new Turkish and Chinese translation. A BIG THANKS to all translators!
+
+#### Other Changes
+
+* Removed the Liberapay donation option as it does not work properly.
+
+#### Bug Fixes
+
+* Fixed the version check for GNOME Shell 42.
+
+## [Burn My Window 12](https://github.com/schneegans/Burn-My-Windows/releases/tag/v12)
+
+**Release Date:** 2022-02-19
#### New Features
+* Added initial support for GNOME Shell 42.
+* The preferences dialog now uses libadwaita on GNOME Shell 42.
+
+#### Enhancements
+
+* Added [Liberapay](https://liberapay.com/Schneegans) to the sponsorship options.
+
+## [Burn My Window 11](https://github.com/schneegans/Burn-My-Windows/releases/tag/v11)
+
+**Release Date:** 2022-02-03
+
+#### New Features
+
+* Added an about-dialog which shows all translators and sponsors.
+
+#### Enhancements
+
+* There are several new translations! Thanks a lot to all the translators! We now have translations for:
+ * German
+ * English
+ * Czech
+ * Dutch
+ * French
+ * Italian
+ * Norwegian Bokmål
+ * Spanish
+* A new issue template for suggesting new effects has been added.
+
+#### Fixes
+
+* Fixed an issue which caused corrupted windows when trying to maximize windows while the window-open animation was still running (#82, #86, #91).
+
+## [Burn My Window 10](https://github.com/schneegans/Burn-My-Windows/releases/tag/v10)
+
+**Release Date:** 2022-01-31
+
+#### New Features
+
+
+
+* **Effects for Window Opening.** You can now select effects which are applied on newly opened windows! I expect that there are some bugs left, so please [report any issue you find](https://github.com/Schneegans/Burn-My-Windows/issues)!
* **New Effect: Broken Glass.** Shatter your windows into a shower sharp shards! This effect can be configured so that the shards fly away from your mouse pointer position!
-* The effect-configuration pages of the preferences dialog now have **Preview Buttons** which con be used to, well, preview the current settings (without having to enable the effect first).
+* **Preview Buttons** have been added to the effect-configuration pages of the preferences dialog. These can be used to, well, preview the current settings (without having to enable the effect first).
+* **Translations!** It is now possible to [translate the preferences dialog](https://hosted.weblate.org/engage/burn-my-windows/). There is already a finished German translation, and in-progress translations to Italian and Norwegian Bokmål.
+* **A "Vertical Overshooting" option** was added to the Matrix Effect: This can add some vertical variation to the start and end position of the letter drops.
#### Other Enhancements
* Added a menu entry with a link to the guide for creating new effect types.
-* Added a new option to the Matrix Effect: **Vertical Overshooting**: This can add some vertical variation to the start and end position of the letter drops.
+* Thanks to improved timing, the default animation time of several effects could be reduced.
+* The README now shows the current lines of code and the current comment percentage using my [dynamic-badges-action](https://github.com/Schneegans/dynamic-badges-action).
+* **Add advanced CI tests:** For each commit to `main`, it is now tested whether the extension can be installed and if the preferences dialog can be shown on GNOME Shell 3.36, 3.38, 40, and 41. Both, X11 and Wayland are checked.
## [Burn My Window 9](https://github.com/schneegans/Burn-My-Windows/releases/tag/v9)
diff --git a/docs/how-to-create-new-effects.md b/docs/how-to-create-new-effects.md
index c1a14f5..7392f69 100644
--- a/docs/how-to-create-new-effects.md
+++ b/docs/how-to-create-new-effects.md
@@ -34,14 +34,14 @@ Of course, you can replace any occurrence of this name and its nick `simple-fade
Three simple steps are required to create a new effect.
You will have to ...
-1. add a preferences key for enabling the effect,
+1. add preferences keys for enabling the effect,
2. create an additional effects class, and finally
3. register the new effect in two places.
### 1. Expanding the Schema
-For enabling the new effect, the boolean settings key `simple-fade-close-effect` is required.
-In this example, we also add an integer valued settings key for storing the animation time of the new effect and a floating point value for storing another property of the effect - we will use them later in the tutorial.
+For enabling the new effect, the boolean settings keys `simple-fade-open-effect`, `simple-fade-close-effect`, and `simple-fade-animation-time` are required.
+In this example, we also add a floating point value for storing another property of the effect - we will use them later in the tutorial.
Just copy the XML code below to the file [`schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml`](../schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml).
Just remember to replace `simple-fade` with your custom name!
@@ -56,6 +56,12 @@ Just remember to replace `simple-fade` with your custom name!
Use the Simple Fade effect for window closing.
+
+ false
+ Simple Fade Open Effect
+ Use the Simple Fade effect for window opening.
+
+
1500Simple Fade Animation Time
@@ -146,16 +152,26 @@ var SimpleFade = class SimpleFade {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For each property, you can set a "from", "to", and a "mode". For this
- // effect, windows should neither be scaled nor faded.
- static getCloseTransition(actor, settings) {
- return {'opacity': {to: 255}, 'scale-x': {to: 1.0}, 'scale-y': {to: 1.0}};
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows should neither be scaled nor faded.
+ static tweakTransition(actor, settings, forOpening) {
+ return {
+ 'opacity': {from: 255, to: 255, mode: 4},
+ 'scale-x': {from: 1.0, to: 1.0, mode: 4},
+ 'scale-y': {from: 1.0, to: 1.0, mode: 4}
+ };
}
}
@@ -172,7 +188,7 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
this.set_shader_source(`
@@ -197,8 +213,10 @@ if (utils.isInShellProcess()) {
// Radial distance from window edge to the window's center.
float dist = length(cogl_tex_coord_in[0].st - 0.5) * 2.0 / sqrt(2.0);
- // This gradually dissolves from [1..0] from the outside to the center.
- float mask = (1.0 - uProgress * (1.0 + FADE_WIDTH) - dist + FADE_WIDTH) / FADE_WIDTH;
+ // This gradually dissolves from [1..0] from the outside to the center. We
+ // switch the direction for opening and closing.
+ float progress = ${forOpening ? '1.0 - uProgress' : 'uProgress'};
+ float mask = (1.0 - progress * (1.0 + FADE_WIDTH) - dist + FADE_WIDTH) / FADE_WIDTH;
// Make the mask smoother.
mask = smoothstep(0, 1, mask);
@@ -324,7 +342,7 @@ Remember to replace any occurrence of `simple-fade` with your effect's nick-name
1
- Reset to Default Value
+ Reset to Default Value
@@ -372,7 +390,7 @@ Remember to replace any occurrence of `simple-fade` with your effect's nick-name
1
- Reset to Default Value
+ Reset to Default Value
@@ -457,7 +475,7 @@ Remember to replace any occurrence of `simple-fade` with your effect's nick-name
- Reset to Default Value
+ Reset to Default Value
@@ -157,7 +157,7 @@
1
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk3/EnergizeB.ui b/resources/ui/gtk3/EnergizeB.ui
index 051821d..b7a8835 100644
--- a/resources/ui/gtk3/EnergizeB.ui
+++ b/resources/ui/gtk3/EnergizeB.ui
@@ -1,10 +1,10 @@
-
+10000
- 500
- 10
+ 100
+ 1100
@@ -65,7 +65,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -114,7 +114,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -157,7 +157,7 @@
1
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk3/Fire.ui b/resources/ui/gtk3/Fire.ui
index 4b43025..5a337bf 100644
--- a/resources/ui/gtk3/Fire.ui
+++ b/resources/ui/gtk3/Fire.ui
@@ -1,10 +1,10 @@
-
+10000
- 500
- 10
+ 100
+ 1100
@@ -116,7 +116,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -164,7 +164,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -212,7 +212,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -274,7 +274,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -342,7 +342,7 @@
1
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk3/TVEffect.ui b/resources/ui/gtk3/TVEffect.ui
index adebe01..f7ef186 100644
--- a/resources/ui/gtk3/TVEffect.ui
+++ b/resources/ui/gtk3/TVEffect.ui
@@ -1,5 +1,5 @@
-
+5000
@@ -58,7 +58,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -101,7 +101,7 @@
1
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk3/Wisps.ui b/resources/ui/gtk3/Wisps.ui
index ff096ae..38c9595 100644
--- a/resources/ui/gtk3/Wisps.ui
+++ b/resources/ui/gtk3/Wisps.ui
@@ -1,10 +1,10 @@
-
+10000
- 500
- 10
+ 100
+ 1100
@@ -65,7 +65,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -114,7 +114,7 @@
1
- Reset to Default Value
+ Reset to Default Value
@@ -157,7 +157,7 @@
1
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk3/effectPage.ui b/resources/ui/gtk3/effectPage.ui
index 2ec5311..cb02379 100644
--- a/resources/ui/gtk3/effectPage.ui
+++ b/resources/ui/gtk3/effectPage.ui
@@ -1,13 +1,9 @@
-
+vertical
- 60
- 60
- 60
- 60110
@@ -44,8 +40,8 @@
diff --git a/resources/ui/gtk3/prefs.ui b/resources/ui/gtk3/prefs.ui
index 8b70434..28859dd 100644
--- a/resources/ui/gtk3/prefs.ui
+++ b/resources/ui/gtk3/prefs.ui
@@ -1,8 +1,9 @@
-
+
+
main-menu
@@ -16,183 +17,220 @@
-
+
+ vertical
+ 30
+ 30
+
-
- main-stack
+
+ center
+ burn-my-windows-symbolic
+ 128
+
-
- slide-up-down
- 1
+
+ Welcome to Burn-My-Windows!
+ 8
+ 6
+
+
+
+
+
+ If you like this extension, recommend it to your friends :)
+ 36
+
+
+
+
+
+
-
- vertical
- 60
- 60
- 30
- 30
+
+ none
-
- center
- burn-my-windows-symbolic
- 128
-
-
-
-
-
- Welcome to Burn-My-Windows!
- 8
- 6
-
-
-
-
-
-
- If you like this extension, recommend it to your friends :)
- 36
-
-
-
-
-
-
+
+ 10
+ 10
+ 10
+ 10
+ 0
-
- none
-
+
+ 8
-
- 10
- 10
- 10
- 10
- 0
+
+ vertical
+ 3
-
- 8
-
-
- vertical
- 3
-
-
- Close Window Animation
- 0
- start
- center
- 1
-
-
-
-
- If multiple are selected, one is chosen randomly.
- 0
- start
- center
- 1
-
-
-
-
-
-
-
- close-effect-menu
-
-
- 8
-
-
- Choose Effects
-
-
-
-
- pan-down-symbolic
- 1
-
-
-
-
-
-
+
+ Open Window Animation
+ 0
+ start
+ center
+ 1
+
+
+
+
+ If multiple are selected, one is chosen randomly.
+ 0
+ start
+ center
+ 1
+
-
-
- 10
- 10
- 10
- 10
- 0
+
+ open-effect-menu8
- Also Burn Dialogs
- 0
- start
- center
- 1
+ Choose Effects
-
- end
- center
-
-
-
-
-
-
- edit-clear-symbolic
- 1
-
-
- Reset to Default Value
-
+
+ pan-down-symbolic
+ 1
-
+
+
+
+ 10
+ 10
+ 10
+ 10
+ 0
+
+
+ 8
+
+
+ vertical
+ 3
+
+
+ Close Window Animation
+ 0
+ start
+ center
+ 1
+
+
+
+
+ If multiple are selected, one is chosen randomly.
+ 0
+ start
+ center
+ 1
+
+
+
+
+
+
+
+ close-effect-menu
+
+
+ 8
+
+
+ Choose Effects
+
+
+
+
+ pan-down-symbolic
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10
+ 10
+ 10
+ 10
+ 0
+
+
+ 8
+
+
+ Also Add Effects to Dialogs
+ 0
+ start
+ center
+ 1
+
+
+
+
+ end
+ center
+
+
+
+
+
+
+ edit-clear-symbolic
+ 1
+
+
+ Reset to Default Value
+
+
+
+
+
+
+
+
-
- general
- General Options
-
-
-
-
-
-
\ No newline at end of file
diff --git a/resources/ui/gtk4/BrokenGlass.ui b/resources/ui/gtk4/BrokenGlass.ui
index 55c30eb..e0dd190 100644
--- a/resources/ui/gtk4/BrokenGlass.ui
+++ b/resources/ui/gtk4/BrokenGlass.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -39,8 +39,8 @@
10000
- 500
- 10
+ 100
+ 1100
@@ -49,7 +49,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -95,7 +95,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -141,7 +141,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -187,7 +187,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -223,6 +223,7 @@
startcenter1
+ 1
diff --git a/resources/ui/gtk4/EnergizeA.ui b/resources/ui/gtk4/EnergizeA.ui
index 5236da0..0c39890 100644
--- a/resources/ui/gtk4/EnergizeA.ui
+++ b/resources/ui/gtk4/EnergizeA.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -39,8 +39,8 @@
10000
- 500
- 10
+ 100
+ 1100
@@ -49,7 +49,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -95,7 +95,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -129,7 +129,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk4/EnergizeB.ui b/resources/ui/gtk4/EnergizeB.ui
index 786afcb..9ea625d 100644
--- a/resources/ui/gtk4/EnergizeB.ui
+++ b/resources/ui/gtk4/EnergizeB.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -39,8 +39,8 @@
10000
- 500
- 10
+ 100
+ 1100
@@ -49,7 +49,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -95,7 +95,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -129,7 +129,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk4/Fire.ui b/resources/ui/gtk4/Fire.ui
index 52c503a..7bd06dc 100644
--- a/resources/ui/gtk4/Fire.ui
+++ b/resources/ui/gtk4/Fire.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -64,8 +64,8 @@
10000
- 500
- 10
+ 100
+ 1100
@@ -74,7 +74,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -120,7 +120,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -166,7 +166,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -219,7 +219,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -277,7 +277,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk4/Matrix.ui b/resources/ui/gtk4/Matrix.ui
index d15e81a..8ccd089 100644
--- a/resources/ui/gtk4/Matrix.ui
+++ b/resources/ui/gtk4/Matrix.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -39,8 +39,8 @@
10000
- 500
- 10
+ 100
+ 1100
@@ -49,7 +49,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -95,7 +95,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -141,7 +141,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -187,7 +187,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -221,7 +221,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -255,7 +255,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk4/TRexAttack.ui b/resources/ui/gtk4/TRexAttack.ui
index b77e7f6..53c8cc6 100644
--- a/resources/ui/gtk4/TRexAttack.ui
+++ b/resources/ui/gtk4/TRexAttack.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -39,8 +39,8 @@
10000
- 500
- 10
+ 100
+ 1100
@@ -49,7 +49,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -95,7 +95,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -141,7 +141,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -187,7 +187,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -221,7 +221,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk4/TVEffect.ui b/resources/ui/gtk4/TVEffect.ui
index f49f0bc..8ecf2c4 100644
--- a/resources/ui/gtk4/TVEffect.ui
+++ b/resources/ui/gtk4/TVEffect.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -49,7 +49,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -83,7 +83,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk4/Wisps.ui b/resources/ui/gtk4/Wisps.ui
index 8e5bcb2..c0dad69 100644
--- a/resources/ui/gtk4/Wisps.ui
+++ b/resources/ui/gtk4/Wisps.ui
@@ -1,5 +1,5 @@
-
+vertical
@@ -39,8 +39,8 @@
10000
- 500
- 10
+ 100
+ 1100
@@ -49,7 +49,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -95,7 +95,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
@@ -129,7 +129,7 @@
edit-clear-symbolic
- Reset to Default Value
+ Reset to Default Value
diff --git a/resources/ui/gtk4/effectPage.ui b/resources/ui/gtk4/effectPage.ui
index f166da6..ceadbbc 100644
--- a/resources/ui/gtk4/effectPage.ui
+++ b/resources/ui/gtk4/effectPage.ui
@@ -1,13 +1,9 @@
-
+vertical
- 60
- 60
- 60
- 60110
@@ -44,8 +40,8 @@
diff --git a/resources/ui/gtk4/prefs.ui b/resources/ui/gtk4/prefs.ui
index 9d77674..2b5778f 100644
--- a/resources/ui/gtk4/prefs.ui
+++ b/resources/ui/gtk4/prefs.ui
@@ -1,167 +1,184 @@
-
+
+
main-menuopen-menu-symbolic
-
+
+ vertical
+ 60
+ 60
+
-
- main-stack
+
+ center
+ burn-my-windows-symbolic
+ 128
+
-
- slide-up-down
- 1
+
+ Welcome to Burn-My-Windows!
+ 8
+ 6
+
+
+
+
+
+ If you like this extension, recommend it to your friends :)
+ 36
+
+
+
+
+
-
- general
- General Options
+
+ none
+ 1
+
-
-
- vertical
- 60
- 60
- 60
- 60
+
+
+ 0
-
- center
- burn-my-windows-symbolic
- 128
-
-
-
-
-
- Welcome to Burn-My-Windows!
- 8
- 6
-
-
-
-
-
-
- If you like this extension, recommend it to your friends :)
- 36
-
-
-
-
-
+
-
- none
- 1
-
-
-
+
+ vertical
+ 3
-
- 0
-
-
-
-
- vertical
- 3
-
-
- Close Window Animation
- 0
- start
- center
- 1
-
-
-
-
- If multiple are selected, one is chosen randomly.
- 0
- start
- center
- 1
-
-
-
-
-
-
-
- Choose Effects
- close-effect-menu
-
-
-
-
+
+ Open Window Animation
+ 0
+ start
+ center
+ 1
-
-
- 0
-
-
-
-
- Also Burn Dialogs
- 0
- start
- center
- 1
-
-
-
-
- end
- center
-
-
-
-
- edit-clear-symbolic
- Reset to Default Value
-
-
-
-
-
+
+ If multiple are selected, one is chosen randomly.
+ 0
+ start
+ center
+ 1
+
-
+
+
+
+
+ Choose Effects
+ open-effect-menu
-
-
+
+
+
+
+ 0
+
+
+
+
+ vertical
+ 3
+
+
+ Close Window Animation
+ 0
+ start
+ center
+ 1
+
+
+
+
+ If multiple are selected, one is chosen randomly.
+ 0
+ start
+ center
+ 1
+
+
+
+
+
+
+
+ Choose Effects
+ close-effect-menu
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+ Also Add Effects to Dialogs
+ 0
+ start
+ center
+ 1
+
+
+
+
+ end
+ center
+
+
+
+
+ edit-clear-symbolic
+ Reset to Default Value
+
+
+
+
+
+
+
+
-
-
-
+
\ No newline at end of file
diff --git a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml
index 0ff056a..7aee264 100644
--- a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml
+++ b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml
@@ -19,6 +19,18 @@
The effect with this nick will be used for the next window-close animation.
+
+ ""
+ Open Preview Effect
+ The effect with this nick will be used for the next window-open animation.
+
+
+
+ false
+ Test Mode
+ If set to true, all animations will show only one still frame to allow for continuous integration tests.
+
+
@@ -29,6 +41,12 @@
Use the fire effect for window closing.
+
+ false
+ Fire Open Effect
+ Use the fire effect for window opening.
+
+
1500Fire Animation Time
@@ -93,8 +111,14 @@
Use the matrix effect for window closing.
+
+ false
+ Matrix Open Effect
+ Use the matrix effect for window opening.
+
+
- 3000
+ 1500Matrix Animation TimeThe time the matrix effect takes.
@@ -139,6 +163,12 @@
Use the tv effect for window closing.
+
+ false
+ TV Open Effect
+ Use the tv effect for window opening.
+
+
400TV Animation Time
@@ -161,8 +191,14 @@
Use the trex effect for window closing.
+
+ false
+ T-Rex Open Effect
+ Use the trex effect for window opening.
+
+
- 1500
+ 1000T-Rex Animation TimeThe time the trex effect takes.
@@ -201,6 +237,12 @@
Use the Energize A effect for window closing.
+
+ false
+ Energize A Open Effect
+ Use the Energize A effect for window opening.
+
+
2000Energize A Animation Time
@@ -229,8 +271,14 @@
Use the Energize B effect for window closing.
+
+ false
+ Energize B Open Effect
+ Use the Energize B effect for window opening.
+
+
- 2000
+ 1000Energize B Animation TimeThe time the Energize B effect takes.
@@ -257,8 +305,14 @@
Use the wisps effect for window closing.
+
+ false
+ Wisps Open Effect
+ Use the wisps effect for window opening.
+
+
- 2000
+ 1500Wisps Animation TimeThe time the wisps effect takes.
@@ -285,8 +339,14 @@
Use the broken glass effect for window closing.
+
+ false
+ Broken Glass Open Effect
+ Use the broken glass effect for window opening.
+
+
- 1500
+ 1000Broken Glass Animation TimeThe time the broken glass effect takes.
diff --git a/src/BrokenGlass.js b/src/BrokenGlass.js
index 63fc480..e455bcf 100644
--- a/src/BrokenGlass.js
+++ b/src/BrokenGlass.js
@@ -15,6 +15,8 @@
const GObject = imports.gi.GObject;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -52,7 +54,7 @@ var BrokenGlass = class BrokenGlass {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'Broken Glass';
+ return _('Broken Glass');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -79,17 +81,24 @@ var BrokenGlass = class BrokenGlass {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(actor, settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(actor, settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, windows are set to twice their original size, so that
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows are set to twice their original size, so that
// we have some space to draw the shards. We also set the animation mode to "Linear".
- static getCloseTransition(actor, settings) {
+ static tweakTransition(actor, settings, forOpening) {
return {
- 'opacity': {to: 255, mode: 1},
+ 'opacity': {from: 255, to: 255, mode: 1},
'scale-x': {from: 2.0, to: 2.0, mode: 1},
'scale-y': {from: 2.0, to: 2.0, mode: 1}
};
@@ -118,16 +127,15 @@ if (utils.isInShellProcess()) {
// resources/img/shards.png. The red channel of the texture contains the distance to the
// shard edges. This information is used to fade out the shards.
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(actor, settings) {
+ _init(actor, settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
// Load the shards texture. As the shader is re-created for each window animation,
// this texture is also re-created each time. This could be improved in the future!
const shardData = GdkPixbuf.Pixbuf.new_from_resource('/img/shards.png');
this._shardTexture = new Clutter.Image();
- this._shardTexture.set_data(
- shardData.get_pixels(), Cogl.PixelFormat.RGB_888, shardData.width,
- shardData.height, shardData.rowstride);
+ this._shardTexture.set_data(shardData.get_pixels(), Cogl.PixelFormat.RGB_888,
+ shardData.width, shardData.height, shardData.rowstride);
// Usually, the shards fly away from the center of the window.
let epicenterX = 0.5;
@@ -141,6 +149,9 @@ if (utils.isInShellProcess()) {
epicenterY = localY / actor.height;
}
+ // If we are currently performing integration test, the animation uses a fixed seed.
+ const testMode = settings.get_boolean('test-mode');
+
this.set_shader_source(`
// Inject some common shader snippets.
@@ -148,19 +159,23 @@ if (utils.isInShellProcess()) {
uniform sampler2D uShardTexture;
- const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
+ const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
+ ${testMode ? 0 : Math.random()});
const float SHARD_SCALE = ${settings.get_double('broken-glass-scale')};
const float SHARD_LAYERS = 5;
- const float GRAVITY = ${settings.get_double('broken-glass-gravity')};
const float BLOW_FORCE = ${settings.get_double('broken-glass-blow-force')};
const float ACTOR_SCALE = 2.0;
const float PADDING = ACTOR_SCALE / 2.0 - 0.5;
const vec2 EPICENTER = vec2(${epicenterX}, ${epicenterY});
+ const float GRAVITY = ${forOpening ? '-1.0' : '1.0'} *
+ ${settings.get_double('broken-glass-gravity')};
void main() {
cogl_color_out = vec4(0, 0, 0, 0);
+ float progress = ${forOpening ? '1.0-uProgress' : 'uProgress'};
+
// Draw the individual shard layers.
for (float i=0; i 0 ? 1: 0;
- windowColor *= dissolve;
-
- cogl_color_out = mix(cogl_color_out, windowColor, windowColor.a);
+ float dissolve = (shardMap.x - pow(progress+0.1, 2)) > 0 ? 1: 0;
+ cogl_color_out = mix(cogl_color_out, windowColor, dissolve);
}
}
}
@@ -218,8 +231,8 @@ if (utils.isInShellProcess()) {
const pipeline = this.get_pipeline();
// Use linear filtering for the window texture.
- pipeline.set_layer_filters(
- 0, Cogl.PipelineFilter.LINEAR, Cogl.PipelineFilter.LINEAR);
+ pipeline.set_layer_filters(0, Cogl.PipelineFilter.LINEAR,
+ Cogl.PipelineFilter.LINEAR);
// Bind the shard texture.
pipeline.set_layer_texture(1, this._shardTexture.get_texture());
diff --git a/src/EnergizeA.js b/src/EnergizeA.js
index cbceeb7..56a75b1 100644
--- a/src/EnergizeA.js
+++ b/src/EnergizeA.js
@@ -15,6 +15,8 @@
const GObject = imports.gi.GObject;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -49,7 +51,7 @@ var EnergizeA = class EnergizeA {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'Energize A';
+ return _('Energize A');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -74,15 +76,26 @@ var EnergizeA = class EnergizeA {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, windows should neither be scaled nor faded.
- static getCloseTransition(actor, settings) {
- return {'opacity': {to: 255}, 'scale-x': {to: 1.0}, 'scale-y': {to: 1.0}};
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows should neither be scaled nor faded.
+ static tweakTransition(actor, settings, forOpening) {
+ return {
+ 'opacity': {from: 255, to: 255, mode: 3},
+ 'scale-x': {from: 1.0, to: 1.0, mode: 3},
+ 'scale-y': {from: 1.0, to: 1.0, mode: 3}
+ };
}
}
@@ -99,11 +112,14 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
const color = Clutter.Color.from_string(settings.get_string('energize-a-color'))[1];
+ // If we are currently performing integration test, the animation uses a fixed seed.
+ const testMode = settings.get_boolean('test-mode');
+
this.set_shader_source(`
// Inject some common shader snippets.
@@ -111,7 +127,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
- const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
+ const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
+ ${testMode ? 0 : Math.random()});
const float FADE_IN_TIME = 0.3;
const float FADE_OUT_TIME = 0.6;
const float HEART_FADE_TIME = 0.3;
@@ -144,6 +161,10 @@ if (utils.isInShellProcess()) {
// Compute fading window opacity.
float windowMask = pow(1.0 - fadeOutProgress, 2.0);
+ #if ${forOpening ? '1' : '0'}
+ windowMask = 1.0 - windowMask;
+ #endif
+
return vec2(atomMask, windowMask);
}
diff --git a/src/EnergizeB.js b/src/EnergizeB.js
index 4592679..6bddbb0 100644
--- a/src/EnergizeB.js
+++ b/src/EnergizeB.js
@@ -15,6 +15,8 @@
const GObject = imports.gi.GObject;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -49,7 +51,7 @@ var EnergizeB = class EnergizeB {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'Energize B';
+ return _('Energize B');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -74,15 +76,26 @@ var EnergizeB = class EnergizeB {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, windows should neither be scaled nor faded.
- static getCloseTransition(actor, settings) {
- return {'opacity': {to: 255}, 'scale-x': {to: 1.0}, 'scale-y': {to: 1.0}};
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows should neither be scaled nor faded.
+ static tweakTransition(actor, settings, forOpening) {
+ return {
+ 'opacity': {from: 255, to: 255, mode: 3},
+ 'scale-x': {from: 1.0, to: 1.0, mode: 3},
+ 'scale-y': {from: 1.0, to: 1.0, mode: 3}
+ };
}
}
@@ -99,11 +112,14 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
const color = Clutter.Color.from_string(settings.get_string('energize-b-color'))[1];
+ // If we are currently performing integration test, the animation uses a fixed seed.
+ const testMode = settings.get_boolean('test-mode');
+
this.set_shader_source(`
// Inject some common shader snippets.
@@ -111,8 +127,9 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
- const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
- const float SHOWER_TIME = 0.2;
+ const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
+ ${testMode ? 0 : Math.random()});
+ const float SHOWER_TIME = 0.3;
const float SHOWER_WIDTH = 0.3;
const float STREAK_TIME = 0.6;
const float EDGE_FADE = 50;
@@ -141,7 +158,7 @@ if (utils.isInShellProcess()) {
float atomMask = getRelativeEdgeMask(0.2);
atomMask = max(0, atomMask - showerMask);
atomMask *= streakMask;
- atomMask *= (1.0 - fadeProgress);
+ atomMask *= sqrt(1-fadeProgress*fadeProgress);
// Make some particles visible in the streaks.
showerMask += 0.05 * streakMask;
@@ -162,6 +179,10 @@ if (utils.isInShellProcess()) {
// Compute fading window opacity.
float windowMask = pow(1.0 - fadeProgress, 2.0);
+ #if ${forOpening ? '1' : '0'}
+ windowMask = 1.0 - windowMask;
+ #endif
+
return vec4(showerMask, streakMask, atomMask, windowMask);
}
diff --git a/src/Fire.js b/src/Fire.js
index a04310c..46a2b23 100644
--- a/src/Fire.js
+++ b/src/Fire.js
@@ -15,6 +15,8 @@
const {Gio, GObject} = imports.gi;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -53,7 +55,7 @@ var Fire = class Fire {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'Fire';
+ return _('Fire');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -96,25 +98,36 @@ var Fire = class Fire {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, windows should neither be scaled nor faded.
- static getCloseTransition(actor, settings) {
- return {'opacity': {to: 255}, 'scale-x': {to: 1.0}, 'scale-y': {to: 1.0}};
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows should neither be scaled nor faded.
+ static tweakTransition(actor, settings, forOpening) {
+ return {
+ 'opacity': {from: 255, to: 255, mode: 3},
+ 'scale-x': {from: 1.0, to: 1.0, mode: 3},
+ 'scale-y': {from: 1.0, to: 1.0, mode: 3}
+ };
}
// ----------------------------------------------------------------------- private stuff
// This populates the preset dropdown menu for the fire options.
static _createFirePresets(dialog) {
- dialog.getBuilder().get_object('settings-widget').connect('realize', (widget) => {
+ dialog.getBuilder().get_object('fire-prefs').connect('realize', (widget) => {
const presets = [
{
- name: 'Default Fire',
+ name: _('Default Fire'),
scale: 1.0,
speed: 0.5,
color1: 'rgba(76, 51, 25, 0.0)',
@@ -124,7 +137,7 @@ var Fire = class Fire {
color5: 'rgba(255, 255, 255, 1)'
},
{
- name: 'Hell Fire',
+ name: _('Hell Fire'),
scale: 1.5,
speed: 0.2,
color1: 'rgba(0,0,0,0)',
@@ -134,7 +147,7 @@ var Fire = class Fire {
color5: 'rgba(255, 255, 255, 1)'
},
{
- name: 'Dark and Smutty',
+ name: _('Dark and Smutty'),
scale: 1.0,
speed: 0.5,
color1: 'rgba(0,0,0,0)',
@@ -144,7 +157,7 @@ var Fire = class Fire {
color5: 'rgb(255,238,166)'
},
{
- name: 'Cold Breeze',
+ name: _('Cold Breeze'),
scale: 1.5,
speed: -0.1,
color1: 'rgba(0,110,255,0)',
@@ -154,7 +167,7 @@ var Fire = class Fire {
color5: 'rgb(97,189,255)'
},
{
- name: 'Santa is Coming',
+ name: _('Santa is Coming'),
scale: 0.4,
speed: -0.5,
color1: 'rgba(0,110,255,0)',
@@ -210,7 +223,7 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
// Load the gradient values from the settings. We directly inject the values in the
@@ -220,9 +233,9 @@ if (utils.isInShellProcess()) {
const gradient = [];
for (let i = 1; i <= 5; i++) {
const color =
- Clutter.Color.from_string(settings.get_string('fire-color-' + i))[1];
+ Clutter.Color.from_string(settings.get_string('fire-color-' + i))[1];
gradient.push(`vec4(${color.red / 255}, ${color.green / 255}, ${
- color.blue / 255}, ${color.alpha / 255})`);
+ color.blue / 255}, ${color.alpha / 255})`);
}
this.set_shader_source(`
@@ -233,7 +246,7 @@ if (utils.isInShellProcess()) {
${shaderSnippets.edgeMask()}
// These may be configurable in the future.
- const float EDGE_FADE = 90;
+ const float EDGE_FADE = 70;
const float FADE_WIDTH = 0.1;
const float HIDE_TIME = 0.4;
const vec2 FIRE_SCALE = vec2(400, 600) * ${settings.get_double('flame-scale')};
@@ -295,6 +308,10 @@ if (utils.isInShellProcess()) {
// Fade at window borders.
effectMask *= getAbsoluteEdgeMask(edgeFadeWidth);
+ #if ${forOpening ? '1' : '0'}
+ windowMask = 1.0 - windowMask;
+ #endif
+
return vec2(windowMask, effectMask);
}
@@ -322,7 +339,7 @@ if (utils.isInShellProcess()) {
cogl_color_out = texture2D(uTexture, cogl_tex_coord_in[0].st) * effectMask.x;
// Add the fire to the window.
- cogl_color_out += fire;
+ cogl_color_out = cogl_color_out * (1.0 - fire.a) + fire;
// These are pretty useful for understanding how this works.
// cogl_color_out = vec4(vec3(noise), 1);
diff --git a/src/Matrix.js b/src/Matrix.js
index 678d5ce..834d36e 100644
--- a/src/Matrix.js
+++ b/src/Matrix.js
@@ -15,6 +15,8 @@
const GObject = imports.gi.GObject;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -53,7 +55,7 @@ var Matrix = class Matrix {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'Matrix';
+ return _('Matrix');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -81,19 +83,27 @@ var Matrix = class Matrix {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, windows should neither be scaled nor faded.
- static getCloseTransition(actor, settings) {
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows should not be faded but scaled vertically to allow for some
+ // overshooting.
+ static tweakTransition(actor, settings, forOpening) {
const yScale = 1.0 + settings.get_double('matrix-overshoot');
return {
- 'opacity': {to: 255},
- 'scale-x': {to: 1.0},
- 'scale-y': {from: yScale, to: yScale}
+ 'opacity': {from: 255, to: 255, mode: 1},
+ 'scale-x': {from: 1.0, to: 1.0, mode: 1},
+ 'scale-y': {from: yScale, to: yScale, mode: 1}
};
}
}
@@ -111,7 +121,7 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
// Load the font texture. As the shader is re-created for each window animation,
@@ -119,14 +129,14 @@ if (utils.isInShellProcess()) {
const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png');
this._fontTexture = new Clutter.Image();
this._fontTexture.set_data(
- fontData.get_pixels(),
- fontData.has_alpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,
- fontData.width, fontData.height, fontData.rowstride);
+ fontData.get_pixels(),
+ fontData.has_alpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,
+ fontData.width, fontData.height, fontData.rowstride);
const trailColor =
- Clutter.Color.from_string(settings.get_string('matrix-trail-color'))[1];
+ Clutter.Color.from_string(settings.get_string('matrix-trail-color'))[1];
const tipColor =
- Clutter.Color.from_string(settings.get_string('matrix-tip-color'))[1];
+ Clutter.Color.from_string(settings.get_string('matrix-tip-color'))[1];
// The technique for this effect was inspired by
// https://www.shadertoy.com/view/ldccW4, however the implementation is quite
@@ -187,6 +197,10 @@ if (utils.isInShellProcess()) {
rainAlpha *= smoothstep(0, 1, clamp(cogl_tex_coord_in[0].y / shorten, 0, 1));
rainAlpha *= smoothstep(0, 1, clamp((1.0 - cogl_tex_coord_in[0].y) / shorten, 0, 1));
+ #if ${forOpening ? '1' : '0'}
+ windowAlpha = 1.0 - windowAlpha;
+ #endif
+
return vec2(rainAlpha, windowAlpha);
}
diff --git a/src/TRexAttack.js b/src/TRexAttack.js
index 380c675..e76f2c1 100644
--- a/src/TRexAttack.js
+++ b/src/TRexAttack.js
@@ -15,6 +15,8 @@
const GObject = imports.gi.GObject;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -51,7 +53,7 @@ var TRexAttack = class TRexAttack {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'T-Rex Attack';
+ return _('T-Rex Attack');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -78,20 +80,26 @@ var TRexAttack = class TRexAttack {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, we slightly increase the window's scale as part of the
- // warp effect.
- static getCloseTransition(actor, settings) {
- const warp = 0.5 * settings.get_double('claw-scratch-warp');
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, we slightly increase the window's scale as part of the warp effect.
+ static tweakTransition(actor, settings, forOpening) {
+ const warp = 1.0 + 0.5 * settings.get_double('claw-scratch-warp');
return {
- 'opacity': {to: 255},
- 'scale-x': {to: 1.0 + warp},
- 'scale-y': {to: 1.0 + warp}
+ 'opacity': {from: 255, to: 255, mode: 3},
+ 'scale-x': {from: forOpening ? warp : 1.0, to: forOpening ? 1.0 : warp, mode: 3},
+ 'scale-y': {from: forOpening ? warp : 1.0, to: forOpening ? 1.0 : warp, mode: 3}
};
}
}
@@ -109,7 +117,7 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
// Load the claw texture. As the shader is re-created for each window animation,
@@ -117,12 +125,14 @@ if (utils.isInShellProcess()) {
// See assets/README.md for how this texture was created.
const clawData = GdkPixbuf.Pixbuf.new_from_resource('/img/claws.png');
this._clawTexture = new Clutter.Image();
- this._clawTexture.set_data(
- clawData.get_pixels(), Cogl.PixelFormat.RGB_888, clawData.width,
- clawData.height, clawData.rowstride);
+ this._clawTexture.set_data(clawData.get_pixels(), Cogl.PixelFormat.RGB_888,
+ clawData.width, clawData.height, clawData.rowstride);
const color =
- Clutter.Color.from_string(settings.get_string('claw-scratch-color'))[1];
+ Clutter.Color.from_string(settings.get_string('claw-scratch-color'))[1];
+
+ // If we are currently performing integration test, the animation uses a fixed seed.
+ const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
@@ -133,13 +143,14 @@ if (utils.isInShellProcess()) {
// See assets/README.md for how this texture was created.
uniform sampler2D uClawTexture;
- const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
+ const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
+ ${testMode ? 0 : Math.random()});
const float CLAW_SIZE = ${settings.get_double('claw-scratch-scale')};
const float NUM_CLAWS = ${settings.get_int('claw-scratch-count')};
const float WARP_INTENSITY = 1.0 + ${settings.get_double('claw-scratch-warp')};
const float FLASH_INTENSITY = 0.1;
- const float MAX_SPAWN_TIME = 0.5; // Scratches will only start in the first half of the animation.
- const float FF_TIME = 0.5; // Relative time for the final fade to transparency.
+ const float MAX_SPAWN_TIME = 0.6; // Scratches will only start in the first half of the animation.
+ const float FF_TIME = 0.6; // Relative time for the final fade to transparency.
// This method generates a grid of randomly rotated, slightly shifted and scaled
// UV squares. It returns the texture coords of the UV square at the given actor
@@ -180,11 +191,13 @@ if (utils.isInShellProcess()) {
void main() {
+ float progress = ${forOpening ? '1.0-uProgress' : 'uProgress'};
+
// Warp the texture coordinates to create a blow-up effect.
vec2 coords = cogl_tex_coord_in[0].st * 2.0 - 1.0;
float dist = length(coords);
coords = (coords/dist * pow(dist, WARP_INTENSITY)) * 0.5 + 0.5;
- coords = mix(cogl_tex_coord_in[0].st, coords, uProgress);
+ coords = mix(cogl_tex_coord_in[0].st, coords, progress);
// Accumulate several random scratches. The color in the scratch map refers to the
// relative time when the respective part will become invisible. Therefore we can
@@ -198,11 +211,11 @@ if (utils.isInShellProcess()) {
// Get the window texture. We shift the texture lookup by the local derivative of
// the claw texture in order to mimic some folding distortion.
- vec2 offset = vec2(dFdx(scratchMap), dFdy(scratchMap)) * uProgress * 0.5;
+ vec2 offset = vec2(dFdx(scratchMap), dFdy(scratchMap)) * progress * 0.5;
cogl_color_out = texture2D(uTexture, coords + offset);
// Add colorful flashes.
- float flashIntensity = 1.0 / FLASH_INTENSITY * (scratchMap - uProgress) + 1;
+ float flashIntensity = 1.0 / FLASH_INTENSITY * (scratchMap - progress) + 1;
if (flashIntensity < 0 || flashIntensity >= 1) {
flashIntensity = 0;
}
@@ -211,17 +224,17 @@ if (utils.isInShellProcess()) {
flashIntensity *= cogl_color_out.a;
// Hide scratched out parts.
- cogl_color_out *= (scratchMap > uProgress ? 1 : 0);
+ cogl_color_out *= (scratchMap > progress ? 1 : 0);
vec3 flashColor = vec3(${color.red / 255},
${color.green / 255},
${color.blue / 255}) * ${color.alpha / 255};
- cogl_color_out.rgb += flashIntensity * mix(flashColor, vec3(0), uProgress);
+ cogl_color_out.rgb += flashIntensity * mix(flashColor, vec3(0), progress);
// Fade out the remaining shards.
- float fade = smoothstep(0, 1, 1 - clamp((uProgress - 1.0 + FF_TIME)/FF_TIME, 0, 1));
- cogl_color_out *= fade;
+ float fadeProgress = smoothstep(0, 1, (progress - 1.0 + FF_TIME)/FF_TIME);
+ cogl_color_out *= sqrt(1-fadeProgress*fadeProgress);
// These are pretty useful for understanding how this works.
// cogl_color_out = vec4(vec3(flashIntensity), 1);
diff --git a/src/TVEffect.js b/src/TVEffect.js
index b171caf..826cf57 100644
--- a/src/TVEffect.js
+++ b/src/TVEffect.js
@@ -15,6 +15,8 @@
const GObject = imports.gi.GObject;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -51,7 +53,7 @@ var TVEffect = class TVEffect {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'TV Effect';
+ return _('TV Effect');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -75,15 +77,26 @@ var TVEffect = class TVEffect {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, windows are scaled down vertically.
- static getCloseTransition(actor, settings) {
- return {'opacity': {to: 255}, 'scale-x': {to: 1.0}, 'scale-y': {to: 0.5}};
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows are scaled down vertically.
+ static tweakTransition(actor, settings, forOpening) {
+ return {
+ 'opacity': {from: 255, to: 255, mode: 3},
+ 'scale-x': {from: 1.0, to: 1.0, mode: 3},
+ 'scale-y': {from: forOpening ? 0.5 : 1.0, to: forOpening ? 1.0 : 0.5, mode: 3}
+ };
}
}
@@ -100,7 +113,7 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
const color = Clutter.Color.from_string(settings.get_string('tv-effect-color'))[1];
@@ -114,17 +127,19 @@ if (utils.isInShellProcess()) {
const float TB_TIME = 0.7; // Relative time for the top/bottom animation.
const float LR_TIME = 0.4; // Relative time for the left/right animation.
const float LR_DELAY = 0.6; // Delay after which the left/right animation starts.
- const float FF_TIME = 0.2; // Relative time for the final fade to transparency.
+ const float FF_TIME = 0.1; // Relative time for the final fade to transparency.
void main() {
+ float progress = ${forOpening ? '1.0-uProgress' : 'uProgress'};
+
// All of these are in [0..1] during the different stages of the animation.
// tb refers to the top-bottom animation.
// lr refers to the left-right animation.
// ff refers to the final fade animation.
- float tbProgress = smoothstep(0, 1, clamp(uProgress/TB_TIME, 0, 1));
- float lrProgress = smoothstep(0, 1, clamp((uProgress - LR_DELAY)/LR_TIME, 0, 1));
- float ffProgress = smoothstep(0, 1, clamp((uProgress - 1.0 + FF_TIME)/FF_TIME, 0, 1));
+ float tbProgress = smoothstep(0, 1, clamp(progress/TB_TIME, 0, 1));
+ float lrProgress = smoothstep(0, 1, clamp((progress - LR_DELAY)/LR_TIME, 0, 1));
+ float ffProgress = smoothstep(0, 1, clamp((progress - 1.0 + FF_TIME)/FF_TIME, 0, 1));
// This is a top-center-bottom gradient in [0..1..0]
float tb = cogl_tex_coord_in[0].t * 2;
@@ -147,7 +162,7 @@ if (utils.isInShellProcess()) {
${color.green / 255},
${color.blue / 255}, 1.0) * windowColor.a;
- windowColor.rgb = mix(windowColor.rgb, effectColor.rgb, smoothstep(0, 1, uProgress));
+ windowColor.rgb = mix(windowColor.rgb, effectColor.rgb, smoothstep(0, 1, progress));
cogl_color_out = windowColor * mask;
diff --git a/src/Wisps.js b/src/Wisps.js
index 030339f..ccbc608 100644
--- a/src/Wisps.js
+++ b/src/Wisps.js
@@ -15,6 +15,8 @@
const GObject = imports.gi.GObject;
+const _ = imports.gettext.domain('burn-my-windows').gettext;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
@@ -50,7 +52,7 @@ var Wisps = class Wisps {
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
static getLabel() {
- return 'Wisps';
+ return _('Wisps');
}
// -------------------------------------------------------------------- API for prefs.js
@@ -75,15 +77,26 @@ var Wisps = class Wisps {
// ---------------------------------------------------------------- API for extension.js
// This is called from extension.js whenever a window is closed with this effect.
- static createShader(actor, settings) {
- return new Shader(settings);
+ static createShader(actor, settings, forOpening) {
+ return new Shader(settings, forOpening);
}
- // This is also called from extension.js. It is used to tweak the ongoing transition of
- // the actor - usually windows are faded to transparency and scaled down slightly by
- // GNOME Shell. For this effect, windows should be scaled down slightly but not faded.
- static getCloseTransition(actor, settings) {
- return {'opacity': {to: 255}, 'scale-x': {to: 0.9}, 'scale-y': {to: 0.9}};
+ // The tweakTransition() is called from extension.js to tweak a window's open / close
+ // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
+ // The parameter 'forOpening' is set to true if this is called for a window-open
+ // transition, for a window-close transition it is set to false. The modes can be set to
+ // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode.
+ // The only required property is 'opacity', even if it transitions from 1.0 to 1.0. The
+ // current value of the opacity transition is passed as uProgress to the shader.
+ // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+.
+
+ // For this effect, windows should be scaled down slightly but not faded.
+ static tweakTransition(actor, settings, forOpening) {
+ return {
+ 'opacity': {from: 255, to: 255, mode: 3},
+ 'scale-x': {from: forOpening ? 0.9 : 1.0, to: forOpening ? 1.0 : 0.9, mode: 3},
+ 'scale-y': {from: forOpening ? 0.9 : 1.0, to: forOpening ? 1.0 : 0.9, mode: 3}
+ };
}
}
@@ -100,11 +113,14 @@ if (utils.isInShellProcess()) {
const shaderSnippets = Me.imports.src.shaderSnippets;
Shader = GObject.registerClass({}, class Shader extends Clutter.ShaderEffect {
- _init(settings) {
+ _init(settings, forOpening) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
const color = Clutter.Color.from_string(settings.get_string('wisps-color'))[1];
+ // If we are currently performing integration test, the animation uses a fixed seed.
+ const testMode = settings.get_boolean('test-mode');
+
this.set_shader_source(`
// Inject some common shader snippets.
@@ -112,7 +128,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
- const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
+ const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
+ ${testMode ? 0 : Math.random()});
const float WISPS_RADIUS = 20.0;
const float WISPS_SPEED = 10.0;
const float WISPS_SPACING = 40 + WISPS_RADIUS;
@@ -159,6 +176,8 @@ if (utils.isInShellProcess()) {
}
void main() {
+
+ float progress = ${forOpening ? '1.0-uProgress' : 'uProgress'};
// Get the color of the window.
vec4 windowColor = texture2D(uTexture, cogl_tex_coord_in[0].st);
@@ -167,7 +186,7 @@ if (utils.isInShellProcess()) {
${color.blue / 255}, 1.0) * windowColor.a;
// Compute several layers of moving wisps.
- vec2 uv = (cogl_tex_coord_in[0].st-0.5) / mix(1.0, 0.5, uProgress) + 0.5;
+ vec2 uv = (cogl_tex_coord_in[0].st-0.5) / mix(1.0, 0.5, progress) + 0.5;
uv /= ${settings.get_double('wisps-scale')};
float wisps = 0;
for (int i=0; i major) {
return true;
}
if (GS_MAJOR == major) {
- return GS_MINOR >= minor;
+ return GS_MINOR >= toNumericVersion(minor);
}
return false;
diff --git a/tests/generate-references.sh b/tests/generate-references.sh
new file mode 100755
index 0000000..a067833
--- /dev/null
+++ b/tests/generate-references.sh
@@ -0,0 +1,183 @@
+#!/bin/bash
+
+# -------------------------------------------------------------------------------------- #
+# ) ( #
+# ( /( ( ( ) ( ( ( ( )\ ) ( ( #
+# )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( #
+# ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ #
+# | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) #
+# | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< #
+# |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ #
+# |__/ #
+# Copyright (c) 2021 Simon Schneegans #
+# Released under the GPLv3 or later. See LICENSE file for details. #
+# -------------------------------------------------------------------------------------- #
+
+# This script is used to generate the reference images required for the run-tests.sh
+# script. To do this, it installs the extension in a fedora-based container running GNOME
+# Shell on xvfb. It requires the burn-my-windows@schneegans.github.com.zip file which is
+# expected to be present in the repository root. Therefore you have to call "make" before
+# this script.
+#
+# The scripts supports two arguments:
+#
+# -v fedora_version: This determines the version of GNOME Shell to test agains.
+# -v 32: GNOME Shell 3.36
+# -v 33: GNOME Shell 3.38
+# -v 34: GNOME Shell 40
+# -v 35: GNOME Shell 41
+# -s session: This can either be "gnome-xsession" or "gnome-wayland-nested".
+
+# Exit on error.
+set -e
+
+usage() {
+ echo "Usage: $0 -v fedora_version -s session" >&2
+}
+
+FEDORA_VERSION=33
+SESSION="gnome-xsession"
+
+while getopts "v:s:h" opt; do
+ case $opt in
+ v) FEDORA_VERSION="${OPTARG}";;
+ s) SESSION="${OPTARG}";;
+ h) usage; exit 0;;
+ *) usage; exit 1;;
+ esac
+done
+
+# Go to the repo root.
+cd "$( cd "$( dirname "$0" )" && pwd )/.." || \
+ { echo "ERROR: Could not find the repo root."; exit 1; }
+
+IMAGE="ghcr.io/schneegans/gnome-shell-pod-${FEDORA_VERSION}"
+EXTENSION="burn-my-windows@schneegans.github.com"
+
+# All references images of the effects are captured at & cropped to this region
+# in the center of the screen. This is kind of arbitrary, but has been choosen so that
+# something is visible from each effect.
+CROP="100x100+910+480"
+
+# Run the container. For more info, visit https://github.com/Schneegans/gnome-shell-pod.
+POD=$(podman run --rm --cap-add=SYS_NICE --cap-add=IPC_LOCK -td "${IMAGE}")
+
+# Properly shutdown podman when this script is exited.
+quit() {
+ podman kill "${POD}"
+ wait
+}
+
+trap quit INT TERM EXIT
+
+# -------------------------------------------------------------------------------- methods
+
+# This function is used below to execute any shell command inside the running container.
+do_in_pod() {
+ podman exec --user gnomeshell --workdir /home/gnomeshell "${POD}" set-env.sh "$@"
+}
+
+# This simulates the given keystroke in the container. Simply calling "xdotool key $1"
+# sometimes fails to be recognized. Maybe the default 12ms between key-down and key-up
+# are too short for xvfb...
+send_keystroke() {
+ do_in_pod xdotool keydown "${1}"
+ sleep 0.5
+ do_in_pod xdotool keyup "${1}"
+}
+
+# This can be used to set a gsettings key of the extension.
+set_setting() {
+ do_in_pod gsettings --schemadir /home/gnomeshell/.local/share/gnome-shell/extensions/burn-my-windows@schneegans.github.com/schemas \
+ set org.gnome.shell.extensions.burn-my-windows "${1}" "${2}"
+}
+
+# This makes a screen capture (cropped to $CROP) inside the container and stores it
+# on the host relative to this script with the given file name.
+capture() {
+ do_in_pod import -window root -crop $CROP out.png
+ podman cp "${POD}":/home/gnomeshell/out.png "${1}"
+}
+
+# This opens the extensions preferences dialog and captures two images: One during the
+# window-open animation, and one during the window-close animation. The sleeps are a bit
+# excessive, but it's difficult to get consistent results with shorter sleeps. The
+# animations are shown for five seconds, so we also have to make sure that one animation
+# is finished before starting the next one.
+capture_effect() {
+ echo "Capturing ${1} effect."
+
+ set_setting "open-preview-effect" "${1}"
+ set_setting "close-preview-effect" "${1}"
+
+ sleep 2
+ do_in_pod gnome-extensions prefs "${EXTENSION}"
+ sleep 2
+ capture "tests/references/${1}-open-${SESSION}-${FEDORA_VERSION}.png"
+ send_keystroke "Alt+F4"
+ sleep 2
+ capture "tests/references/${1}-close-${SESSION}-${FEDORA_VERSION}.png"
+ sleep 2
+}
+
+# ----------------------------------------------------- wait for the container to start up
+
+echo "Waiting for D-Bus."
+do_in_pod wait-user-bus.sh > /dev/null 2>&1
+
+
+# ----------------------------------------------------- install the to-be-tested extension
+
+echo "Installing extension."
+podman cp "tests/references" "${POD}:/home/gnomeshell/references"
+podman cp "${EXTENSION}.zip" "${POD}:/home/gnomeshell"
+do_in_pod gnome-extensions install "${EXTENSION}.zip"
+
+
+# ---------------------------------------------------------------------- start GNOME Shell
+
+# Starting with GNOME 40, there is a "Welcome Tour" dialog popping up at first launch.
+# We disable this beforehand.
+if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
+ echo "Disabling welcome tour."
+ do_in_pod gsettings set org.gnome.shell welcome-dialog-last-shown-version "999" || true
+fi
+
+echo "Starting $(do_in_pod gnome-shell --version)."
+do_in_pod systemctl --user start "${SESSION}@:99"
+sleep 10
+
+# Enable the extension.
+do_in_pod gnome-extensions enable "${EXTENSION}"
+
+# Starting with GNOME 40, the overview is the default mode. We close this here by hitting
+# the super key.
+if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
+ echo "Closing Overview."
+ send_keystroke "super"
+fi
+
+# Wait until the extension is enabled and the overview closed.
+sleep 3
+
+
+# --------------------------------------------------------------------- capture the images
+
+# The test mode ensures that the animations are "frozen" and do not change in time.
+echo "Entering test mode."
+set_setting "test-mode" true
+do_in_pod gsettings set org.gnome.mutter center-new-windows true
+
+capture_effect "energize-a"
+capture_effect "energize-b"
+capture_effect "fire"
+capture_effect "tv"
+capture_effect "wisps"
+
+if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
+ capture_effect "trex"
+ capture_effect "broken-glass"
+ capture_effect "matrix"
+fi
+
+echo "All reference images generated successfully."
diff --git a/tests/references/broken-glass-close-gnome-wayland-nested-34.png b/tests/references/broken-glass-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..0411c8e
Binary files /dev/null and b/tests/references/broken-glass-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/broken-glass-close-gnome-wayland-nested-35.png b/tests/references/broken-glass-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..1f1989f
Binary files /dev/null and b/tests/references/broken-glass-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/broken-glass-close-gnome-wayland-nested-36.png b/tests/references/broken-glass-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..543aed5
Binary files /dev/null and b/tests/references/broken-glass-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/broken-glass-close-gnome-xsession-34.png b/tests/references/broken-glass-close-gnome-xsession-34.png
new file mode 100644
index 0000000..85fc38f
Binary files /dev/null and b/tests/references/broken-glass-close-gnome-xsession-34.png differ
diff --git a/tests/references/broken-glass-close-gnome-xsession-35.png b/tests/references/broken-glass-close-gnome-xsession-35.png
new file mode 100644
index 0000000..27373eb
Binary files /dev/null and b/tests/references/broken-glass-close-gnome-xsession-35.png differ
diff --git a/tests/references/broken-glass-close-gnome-xsession-36.png b/tests/references/broken-glass-close-gnome-xsession-36.png
new file mode 100644
index 0000000..180b488
Binary files /dev/null and b/tests/references/broken-glass-close-gnome-xsession-36.png differ
diff --git a/tests/references/broken-glass-open-gnome-wayland-nested-34.png b/tests/references/broken-glass-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..f695659
Binary files /dev/null and b/tests/references/broken-glass-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/broken-glass-open-gnome-wayland-nested-35.png b/tests/references/broken-glass-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..071f22f
Binary files /dev/null and b/tests/references/broken-glass-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/broken-glass-open-gnome-wayland-nested-36.png b/tests/references/broken-glass-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..3622103
Binary files /dev/null and b/tests/references/broken-glass-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/broken-glass-open-gnome-xsession-34.png b/tests/references/broken-glass-open-gnome-xsession-34.png
new file mode 100644
index 0000000..64bbf3a
Binary files /dev/null and b/tests/references/broken-glass-open-gnome-xsession-34.png differ
diff --git a/tests/references/broken-glass-open-gnome-xsession-35.png b/tests/references/broken-glass-open-gnome-xsession-35.png
new file mode 100644
index 0000000..63df622
Binary files /dev/null and b/tests/references/broken-glass-open-gnome-xsession-35.png differ
diff --git a/tests/references/broken-glass-open-gnome-xsession-36.png b/tests/references/broken-glass-open-gnome-xsession-36.png
new file mode 100644
index 0000000..76bb6b0
Binary files /dev/null and b/tests/references/broken-glass-open-gnome-xsession-36.png differ
diff --git a/tests/references/energize-a-close-gnome-wayland-nested-32.png b/tests/references/energize-a-close-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..f6b5dcc
Binary files /dev/null and b/tests/references/energize-a-close-gnome-wayland-nested-32.png differ
diff --git a/tests/references/energize-a-close-gnome-wayland-nested-33.png b/tests/references/energize-a-close-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..97e5ce2
Binary files /dev/null and b/tests/references/energize-a-close-gnome-wayland-nested-33.png differ
diff --git a/tests/references/energize-a-close-gnome-wayland-nested-34.png b/tests/references/energize-a-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..653dd03
Binary files /dev/null and b/tests/references/energize-a-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/energize-a-close-gnome-wayland-nested-35.png b/tests/references/energize-a-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..653dd03
Binary files /dev/null and b/tests/references/energize-a-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/energize-a-close-gnome-wayland-nested-36.png b/tests/references/energize-a-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..1c682c0
Binary files /dev/null and b/tests/references/energize-a-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/energize-a-close-gnome-xsession-32.png b/tests/references/energize-a-close-gnome-xsession-32.png
new file mode 100644
index 0000000..f6b5dcc
Binary files /dev/null and b/tests/references/energize-a-close-gnome-xsession-32.png differ
diff --git a/tests/references/energize-a-close-gnome-xsession-33.png b/tests/references/energize-a-close-gnome-xsession-33.png
new file mode 100644
index 0000000..97e5ce2
Binary files /dev/null and b/tests/references/energize-a-close-gnome-xsession-33.png differ
diff --git a/tests/references/energize-a-close-gnome-xsession-34.png b/tests/references/energize-a-close-gnome-xsession-34.png
new file mode 100644
index 0000000..0f41509
Binary files /dev/null and b/tests/references/energize-a-close-gnome-xsession-34.png differ
diff --git a/tests/references/energize-a-close-gnome-xsession-35.png b/tests/references/energize-a-close-gnome-xsession-35.png
new file mode 100644
index 0000000..0f41509
Binary files /dev/null and b/tests/references/energize-a-close-gnome-xsession-35.png differ
diff --git a/tests/references/energize-a-close-gnome-xsession-36.png b/tests/references/energize-a-close-gnome-xsession-36.png
new file mode 100644
index 0000000..5ac8576
Binary files /dev/null and b/tests/references/energize-a-close-gnome-xsession-36.png differ
diff --git a/tests/references/energize-a-open-gnome-wayland-nested-32.png b/tests/references/energize-a-open-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..fcefdfc
Binary files /dev/null and b/tests/references/energize-a-open-gnome-wayland-nested-32.png differ
diff --git a/tests/references/energize-a-open-gnome-wayland-nested-33.png b/tests/references/energize-a-open-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..3969643
Binary files /dev/null and b/tests/references/energize-a-open-gnome-wayland-nested-33.png differ
diff --git a/tests/references/energize-a-open-gnome-wayland-nested-34.png b/tests/references/energize-a-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..102c6b7
Binary files /dev/null and b/tests/references/energize-a-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/energize-a-open-gnome-wayland-nested-35.png b/tests/references/energize-a-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..102c6b7
Binary files /dev/null and b/tests/references/energize-a-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/energize-a-open-gnome-wayland-nested-36.png b/tests/references/energize-a-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..6dd8e2e
Binary files /dev/null and b/tests/references/energize-a-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/energize-a-open-gnome-xsession-32.png b/tests/references/energize-a-open-gnome-xsession-32.png
new file mode 100644
index 0000000..fcefdfc
Binary files /dev/null and b/tests/references/energize-a-open-gnome-xsession-32.png differ
diff --git a/tests/references/energize-a-open-gnome-xsession-33.png b/tests/references/energize-a-open-gnome-xsession-33.png
new file mode 100644
index 0000000..3969643
Binary files /dev/null and b/tests/references/energize-a-open-gnome-xsession-33.png differ
diff --git a/tests/references/energize-a-open-gnome-xsession-34.png b/tests/references/energize-a-open-gnome-xsession-34.png
new file mode 100644
index 0000000..69677e8
Binary files /dev/null and b/tests/references/energize-a-open-gnome-xsession-34.png differ
diff --git a/tests/references/energize-a-open-gnome-xsession-35.png b/tests/references/energize-a-open-gnome-xsession-35.png
new file mode 100644
index 0000000..69677e8
Binary files /dev/null and b/tests/references/energize-a-open-gnome-xsession-35.png differ
diff --git a/tests/references/energize-a-open-gnome-xsession-36.png b/tests/references/energize-a-open-gnome-xsession-36.png
new file mode 100644
index 0000000..88ee669
Binary files /dev/null and b/tests/references/energize-a-open-gnome-xsession-36.png differ
diff --git a/tests/references/energize-b-close-gnome-wayland-nested-32.png b/tests/references/energize-b-close-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..8419318
Binary files /dev/null and b/tests/references/energize-b-close-gnome-wayland-nested-32.png differ
diff --git a/tests/references/energize-b-close-gnome-wayland-nested-33.png b/tests/references/energize-b-close-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..6725b9e
Binary files /dev/null and b/tests/references/energize-b-close-gnome-wayland-nested-33.png differ
diff --git a/tests/references/energize-b-close-gnome-wayland-nested-34.png b/tests/references/energize-b-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..7e8ce24
Binary files /dev/null and b/tests/references/energize-b-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/energize-b-close-gnome-wayland-nested-35.png b/tests/references/energize-b-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..7e8ce24
Binary files /dev/null and b/tests/references/energize-b-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/energize-b-close-gnome-wayland-nested-36.png b/tests/references/energize-b-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..a0f1ece
Binary files /dev/null and b/tests/references/energize-b-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/energize-b-close-gnome-xsession-32.png b/tests/references/energize-b-close-gnome-xsession-32.png
new file mode 100644
index 0000000..8419318
Binary files /dev/null and b/tests/references/energize-b-close-gnome-xsession-32.png differ
diff --git a/tests/references/energize-b-close-gnome-xsession-33.png b/tests/references/energize-b-close-gnome-xsession-33.png
new file mode 100644
index 0000000..6725b9e
Binary files /dev/null and b/tests/references/energize-b-close-gnome-xsession-33.png differ
diff --git a/tests/references/energize-b-close-gnome-xsession-34.png b/tests/references/energize-b-close-gnome-xsession-34.png
new file mode 100644
index 0000000..5c629cf
Binary files /dev/null and b/tests/references/energize-b-close-gnome-xsession-34.png differ
diff --git a/tests/references/energize-b-close-gnome-xsession-35.png b/tests/references/energize-b-close-gnome-xsession-35.png
new file mode 100644
index 0000000..5c629cf
Binary files /dev/null and b/tests/references/energize-b-close-gnome-xsession-35.png differ
diff --git a/tests/references/energize-b-close-gnome-xsession-36.png b/tests/references/energize-b-close-gnome-xsession-36.png
new file mode 100644
index 0000000..728d3d4
Binary files /dev/null and b/tests/references/energize-b-close-gnome-xsession-36.png differ
diff --git a/tests/references/energize-b-open-gnome-wayland-nested-32.png b/tests/references/energize-b-open-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..7c1297b
Binary files /dev/null and b/tests/references/energize-b-open-gnome-wayland-nested-32.png differ
diff --git a/tests/references/energize-b-open-gnome-wayland-nested-33.png b/tests/references/energize-b-open-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..8c56a56
Binary files /dev/null and b/tests/references/energize-b-open-gnome-wayland-nested-33.png differ
diff --git a/tests/references/energize-b-open-gnome-wayland-nested-34.png b/tests/references/energize-b-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..0046ebe
Binary files /dev/null and b/tests/references/energize-b-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/energize-b-open-gnome-wayland-nested-35.png b/tests/references/energize-b-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..0046ebe
Binary files /dev/null and b/tests/references/energize-b-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/energize-b-open-gnome-wayland-nested-36.png b/tests/references/energize-b-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..eb10914
Binary files /dev/null and b/tests/references/energize-b-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/energize-b-open-gnome-xsession-32.png b/tests/references/energize-b-open-gnome-xsession-32.png
new file mode 100644
index 0000000..7c1297b
Binary files /dev/null and b/tests/references/energize-b-open-gnome-xsession-32.png differ
diff --git a/tests/references/energize-b-open-gnome-xsession-33.png b/tests/references/energize-b-open-gnome-xsession-33.png
new file mode 100644
index 0000000..8c56a56
Binary files /dev/null and b/tests/references/energize-b-open-gnome-xsession-33.png differ
diff --git a/tests/references/energize-b-open-gnome-xsession-34.png b/tests/references/energize-b-open-gnome-xsession-34.png
new file mode 100644
index 0000000..2245ffe
Binary files /dev/null and b/tests/references/energize-b-open-gnome-xsession-34.png differ
diff --git a/tests/references/energize-b-open-gnome-xsession-35.png b/tests/references/energize-b-open-gnome-xsession-35.png
new file mode 100644
index 0000000..2245ffe
Binary files /dev/null and b/tests/references/energize-b-open-gnome-xsession-35.png differ
diff --git a/tests/references/energize-b-open-gnome-xsession-36.png b/tests/references/energize-b-open-gnome-xsession-36.png
new file mode 100644
index 0000000..51cc8b6
Binary files /dev/null and b/tests/references/energize-b-open-gnome-xsession-36.png differ
diff --git a/tests/references/fire-close-gnome-wayland-nested-32.png b/tests/references/fire-close-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..08e36b8
Binary files /dev/null and b/tests/references/fire-close-gnome-wayland-nested-32.png differ
diff --git a/tests/references/fire-close-gnome-wayland-nested-33.png b/tests/references/fire-close-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..8398e90
Binary files /dev/null and b/tests/references/fire-close-gnome-wayland-nested-33.png differ
diff --git a/tests/references/fire-close-gnome-wayland-nested-34.png b/tests/references/fire-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..17f8f4c
Binary files /dev/null and b/tests/references/fire-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/fire-close-gnome-wayland-nested-35.png b/tests/references/fire-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..17f8f4c
Binary files /dev/null and b/tests/references/fire-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/fire-close-gnome-wayland-nested-36.png b/tests/references/fire-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..59dde9a
Binary files /dev/null and b/tests/references/fire-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/fire-close-gnome-xsession-32.png b/tests/references/fire-close-gnome-xsession-32.png
new file mode 100644
index 0000000..08e36b8
Binary files /dev/null and b/tests/references/fire-close-gnome-xsession-32.png differ
diff --git a/tests/references/fire-close-gnome-xsession-33.png b/tests/references/fire-close-gnome-xsession-33.png
new file mode 100644
index 0000000..8398e90
Binary files /dev/null and b/tests/references/fire-close-gnome-xsession-33.png differ
diff --git a/tests/references/fire-close-gnome-xsession-34.png b/tests/references/fire-close-gnome-xsession-34.png
new file mode 100644
index 0000000..38ac0c5
Binary files /dev/null and b/tests/references/fire-close-gnome-xsession-34.png differ
diff --git a/tests/references/fire-close-gnome-xsession-35.png b/tests/references/fire-close-gnome-xsession-35.png
new file mode 100644
index 0000000..38ac0c5
Binary files /dev/null and b/tests/references/fire-close-gnome-xsession-35.png differ
diff --git a/tests/references/fire-close-gnome-xsession-36.png b/tests/references/fire-close-gnome-xsession-36.png
new file mode 100644
index 0000000..8b9fca9
Binary files /dev/null and b/tests/references/fire-close-gnome-xsession-36.png differ
diff --git a/tests/references/fire-open-gnome-wayland-nested-32.png b/tests/references/fire-open-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..3e76277
Binary files /dev/null and b/tests/references/fire-open-gnome-wayland-nested-32.png differ
diff --git a/tests/references/fire-open-gnome-wayland-nested-33.png b/tests/references/fire-open-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..668fa28
Binary files /dev/null and b/tests/references/fire-open-gnome-wayland-nested-33.png differ
diff --git a/tests/references/fire-open-gnome-wayland-nested-34.png b/tests/references/fire-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..a258046
Binary files /dev/null and b/tests/references/fire-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/fire-open-gnome-wayland-nested-35.png b/tests/references/fire-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..a258046
Binary files /dev/null and b/tests/references/fire-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/fire-open-gnome-wayland-nested-36.png b/tests/references/fire-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..456f20b
Binary files /dev/null and b/tests/references/fire-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/fire-open-gnome-xsession-32.png b/tests/references/fire-open-gnome-xsession-32.png
new file mode 100644
index 0000000..3e76277
Binary files /dev/null and b/tests/references/fire-open-gnome-xsession-32.png differ
diff --git a/tests/references/fire-open-gnome-xsession-33.png b/tests/references/fire-open-gnome-xsession-33.png
new file mode 100644
index 0000000..668fa28
Binary files /dev/null and b/tests/references/fire-open-gnome-xsession-33.png differ
diff --git a/tests/references/fire-open-gnome-xsession-34.png b/tests/references/fire-open-gnome-xsession-34.png
new file mode 100644
index 0000000..b257176
Binary files /dev/null and b/tests/references/fire-open-gnome-xsession-34.png differ
diff --git a/tests/references/fire-open-gnome-xsession-35.png b/tests/references/fire-open-gnome-xsession-35.png
new file mode 100644
index 0000000..b257176
Binary files /dev/null and b/tests/references/fire-open-gnome-xsession-35.png differ
diff --git a/tests/references/fire-open-gnome-xsession-36.png b/tests/references/fire-open-gnome-xsession-36.png
new file mode 100644
index 0000000..ade8bfa
Binary files /dev/null and b/tests/references/fire-open-gnome-xsession-36.png differ
diff --git a/tests/references/matrix-close-gnome-wayland-nested-34.png b/tests/references/matrix-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..a1b5672
Binary files /dev/null and b/tests/references/matrix-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/matrix-close-gnome-wayland-nested-35.png b/tests/references/matrix-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..85abebf
Binary files /dev/null and b/tests/references/matrix-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/matrix-close-gnome-wayland-nested-36.png b/tests/references/matrix-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..6c7392a
Binary files /dev/null and b/tests/references/matrix-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/matrix-close-gnome-xsession-34.png b/tests/references/matrix-close-gnome-xsession-34.png
new file mode 100644
index 0000000..9ae6901
Binary files /dev/null and b/tests/references/matrix-close-gnome-xsession-34.png differ
diff --git a/tests/references/matrix-close-gnome-xsession-35.png b/tests/references/matrix-close-gnome-xsession-35.png
new file mode 100644
index 0000000..74ba79e
Binary files /dev/null and b/tests/references/matrix-close-gnome-xsession-35.png differ
diff --git a/tests/references/matrix-close-gnome-xsession-36.png b/tests/references/matrix-close-gnome-xsession-36.png
new file mode 100644
index 0000000..02dbabf
Binary files /dev/null and b/tests/references/matrix-close-gnome-xsession-36.png differ
diff --git a/tests/references/matrix-open-gnome-wayland-nested-34.png b/tests/references/matrix-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..14df9ca
Binary files /dev/null and b/tests/references/matrix-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/matrix-open-gnome-wayland-nested-35.png b/tests/references/matrix-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..201b487
Binary files /dev/null and b/tests/references/matrix-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/matrix-open-gnome-wayland-nested-36.png b/tests/references/matrix-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..58c8581
Binary files /dev/null and b/tests/references/matrix-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/matrix-open-gnome-xsession-34.png b/tests/references/matrix-open-gnome-xsession-34.png
new file mode 100644
index 0000000..750f732
Binary files /dev/null and b/tests/references/matrix-open-gnome-xsession-34.png differ
diff --git a/tests/references/matrix-open-gnome-xsession-35.png b/tests/references/matrix-open-gnome-xsession-35.png
new file mode 100644
index 0000000..eb932e2
Binary files /dev/null and b/tests/references/matrix-open-gnome-xsession-35.png differ
diff --git a/tests/references/matrix-open-gnome-xsession-36.png b/tests/references/matrix-open-gnome-xsession-36.png
new file mode 100644
index 0000000..523a068
Binary files /dev/null and b/tests/references/matrix-open-gnome-xsession-36.png differ
diff --git a/tests/references/trex-close-gnome-wayland-nested-34.png b/tests/references/trex-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..4beed8b
Binary files /dev/null and b/tests/references/trex-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/trex-close-gnome-wayland-nested-35.png b/tests/references/trex-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..e8549c1
Binary files /dev/null and b/tests/references/trex-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/trex-close-gnome-wayland-nested-36.png b/tests/references/trex-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..6af9081
Binary files /dev/null and b/tests/references/trex-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/trex-close-gnome-xsession-34.png b/tests/references/trex-close-gnome-xsession-34.png
new file mode 100644
index 0000000..fc8b2a2
Binary files /dev/null and b/tests/references/trex-close-gnome-xsession-34.png differ
diff --git a/tests/references/trex-close-gnome-xsession-35.png b/tests/references/trex-close-gnome-xsession-35.png
new file mode 100644
index 0000000..2a0f280
Binary files /dev/null and b/tests/references/trex-close-gnome-xsession-35.png differ
diff --git a/tests/references/trex-close-gnome-xsession-36.png b/tests/references/trex-close-gnome-xsession-36.png
new file mode 100644
index 0000000..52a6621
Binary files /dev/null and b/tests/references/trex-close-gnome-xsession-36.png differ
diff --git a/tests/references/trex-open-gnome-wayland-nested-34.png b/tests/references/trex-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..4beed8b
Binary files /dev/null and b/tests/references/trex-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/trex-open-gnome-wayland-nested-35.png b/tests/references/trex-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..e8549c1
Binary files /dev/null and b/tests/references/trex-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/trex-open-gnome-wayland-nested-36.png b/tests/references/trex-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..6af9081
Binary files /dev/null and b/tests/references/trex-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/trex-open-gnome-xsession-34.png b/tests/references/trex-open-gnome-xsession-34.png
new file mode 100644
index 0000000..fc8b2a2
Binary files /dev/null and b/tests/references/trex-open-gnome-xsession-34.png differ
diff --git a/tests/references/trex-open-gnome-xsession-35.png b/tests/references/trex-open-gnome-xsession-35.png
new file mode 100644
index 0000000..2a0f280
Binary files /dev/null and b/tests/references/trex-open-gnome-xsession-35.png differ
diff --git a/tests/references/trex-open-gnome-xsession-36.png b/tests/references/trex-open-gnome-xsession-36.png
new file mode 100644
index 0000000..52a6621
Binary files /dev/null and b/tests/references/trex-open-gnome-xsession-36.png differ
diff --git a/tests/references/tv-close-gnome-wayland-nested-32.png b/tests/references/tv-close-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..affa8bb
Binary files /dev/null and b/tests/references/tv-close-gnome-wayland-nested-32.png differ
diff --git a/tests/references/tv-close-gnome-wayland-nested-33.png b/tests/references/tv-close-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..86b3bba
Binary files /dev/null and b/tests/references/tv-close-gnome-wayland-nested-33.png differ
diff --git a/tests/references/tv-close-gnome-wayland-nested-34.png b/tests/references/tv-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..dbba5c5
Binary files /dev/null and b/tests/references/tv-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/tv-close-gnome-wayland-nested-35.png b/tests/references/tv-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..dbba5c5
Binary files /dev/null and b/tests/references/tv-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/tv-close-gnome-wayland-nested-36.png b/tests/references/tv-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..11334dc
Binary files /dev/null and b/tests/references/tv-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/tv-close-gnome-xsession-32.png b/tests/references/tv-close-gnome-xsession-32.png
new file mode 100644
index 0000000..affa8bb
Binary files /dev/null and b/tests/references/tv-close-gnome-xsession-32.png differ
diff --git a/tests/references/tv-close-gnome-xsession-33.png b/tests/references/tv-close-gnome-xsession-33.png
new file mode 100644
index 0000000..86b3bba
Binary files /dev/null and b/tests/references/tv-close-gnome-xsession-33.png differ
diff --git a/tests/references/tv-close-gnome-xsession-34.png b/tests/references/tv-close-gnome-xsession-34.png
new file mode 100644
index 0000000..146c0c7
Binary files /dev/null and b/tests/references/tv-close-gnome-xsession-34.png differ
diff --git a/tests/references/tv-close-gnome-xsession-35.png b/tests/references/tv-close-gnome-xsession-35.png
new file mode 100644
index 0000000..146c0c7
Binary files /dev/null and b/tests/references/tv-close-gnome-xsession-35.png differ
diff --git a/tests/references/tv-close-gnome-xsession-36.png b/tests/references/tv-close-gnome-xsession-36.png
new file mode 100644
index 0000000..a9daef2
Binary files /dev/null and b/tests/references/tv-close-gnome-xsession-36.png differ
diff --git a/tests/references/tv-open-gnome-wayland-nested-32.png b/tests/references/tv-open-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..affa8bb
Binary files /dev/null and b/tests/references/tv-open-gnome-wayland-nested-32.png differ
diff --git a/tests/references/tv-open-gnome-wayland-nested-33.png b/tests/references/tv-open-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..86b3bba
Binary files /dev/null and b/tests/references/tv-open-gnome-wayland-nested-33.png differ
diff --git a/tests/references/tv-open-gnome-wayland-nested-34.png b/tests/references/tv-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..dbba5c5
Binary files /dev/null and b/tests/references/tv-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/tv-open-gnome-wayland-nested-35.png b/tests/references/tv-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..dbba5c5
Binary files /dev/null and b/tests/references/tv-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/tv-open-gnome-wayland-nested-36.png b/tests/references/tv-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..11334dc
Binary files /dev/null and b/tests/references/tv-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/tv-open-gnome-xsession-32.png b/tests/references/tv-open-gnome-xsession-32.png
new file mode 100644
index 0000000..affa8bb
Binary files /dev/null and b/tests/references/tv-open-gnome-xsession-32.png differ
diff --git a/tests/references/tv-open-gnome-xsession-33.png b/tests/references/tv-open-gnome-xsession-33.png
new file mode 100644
index 0000000..86b3bba
Binary files /dev/null and b/tests/references/tv-open-gnome-xsession-33.png differ
diff --git a/tests/references/tv-open-gnome-xsession-34.png b/tests/references/tv-open-gnome-xsession-34.png
new file mode 100644
index 0000000..146c0c7
Binary files /dev/null and b/tests/references/tv-open-gnome-xsession-34.png differ
diff --git a/tests/references/tv-open-gnome-xsession-35.png b/tests/references/tv-open-gnome-xsession-35.png
new file mode 100644
index 0000000..146c0c7
Binary files /dev/null and b/tests/references/tv-open-gnome-xsession-35.png differ
diff --git a/tests/references/tv-open-gnome-xsession-36.png b/tests/references/tv-open-gnome-xsession-36.png
new file mode 100644
index 0000000..a9daef2
Binary files /dev/null and b/tests/references/tv-open-gnome-xsession-36.png differ
diff --git a/tests/references/wisps-close-gnome-wayland-nested-32.png b/tests/references/wisps-close-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..5f8f9a3
Binary files /dev/null and b/tests/references/wisps-close-gnome-wayland-nested-32.png differ
diff --git a/tests/references/wisps-close-gnome-wayland-nested-33.png b/tests/references/wisps-close-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..6ce4190
Binary files /dev/null and b/tests/references/wisps-close-gnome-wayland-nested-33.png differ
diff --git a/tests/references/wisps-close-gnome-wayland-nested-34.png b/tests/references/wisps-close-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..c9b246c
Binary files /dev/null and b/tests/references/wisps-close-gnome-wayland-nested-34.png differ
diff --git a/tests/references/wisps-close-gnome-wayland-nested-35.png b/tests/references/wisps-close-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..c9b246c
Binary files /dev/null and b/tests/references/wisps-close-gnome-wayland-nested-35.png differ
diff --git a/tests/references/wisps-close-gnome-wayland-nested-36.png b/tests/references/wisps-close-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..f58a196
Binary files /dev/null and b/tests/references/wisps-close-gnome-wayland-nested-36.png differ
diff --git a/tests/references/wisps-close-gnome-xsession-32.png b/tests/references/wisps-close-gnome-xsession-32.png
new file mode 100644
index 0000000..5f8f9a3
Binary files /dev/null and b/tests/references/wisps-close-gnome-xsession-32.png differ
diff --git a/tests/references/wisps-close-gnome-xsession-33.png b/tests/references/wisps-close-gnome-xsession-33.png
new file mode 100644
index 0000000..6ce4190
Binary files /dev/null and b/tests/references/wisps-close-gnome-xsession-33.png differ
diff --git a/tests/references/wisps-close-gnome-xsession-34.png b/tests/references/wisps-close-gnome-xsession-34.png
new file mode 100644
index 0000000..a2a5254
Binary files /dev/null and b/tests/references/wisps-close-gnome-xsession-34.png differ
diff --git a/tests/references/wisps-close-gnome-xsession-35.png b/tests/references/wisps-close-gnome-xsession-35.png
new file mode 100644
index 0000000..a2a5254
Binary files /dev/null and b/tests/references/wisps-close-gnome-xsession-35.png differ
diff --git a/tests/references/wisps-close-gnome-xsession-36.png b/tests/references/wisps-close-gnome-xsession-36.png
new file mode 100644
index 0000000..04ca5d4
Binary files /dev/null and b/tests/references/wisps-close-gnome-xsession-36.png differ
diff --git a/tests/references/wisps-open-gnome-wayland-nested-32.png b/tests/references/wisps-open-gnome-wayland-nested-32.png
new file mode 100644
index 0000000..5f8f9a3
Binary files /dev/null and b/tests/references/wisps-open-gnome-wayland-nested-32.png differ
diff --git a/tests/references/wisps-open-gnome-wayland-nested-33.png b/tests/references/wisps-open-gnome-wayland-nested-33.png
new file mode 100644
index 0000000..6ce4190
Binary files /dev/null and b/tests/references/wisps-open-gnome-wayland-nested-33.png differ
diff --git a/tests/references/wisps-open-gnome-wayland-nested-34.png b/tests/references/wisps-open-gnome-wayland-nested-34.png
new file mode 100644
index 0000000..c9b246c
Binary files /dev/null and b/tests/references/wisps-open-gnome-wayland-nested-34.png differ
diff --git a/tests/references/wisps-open-gnome-wayland-nested-35.png b/tests/references/wisps-open-gnome-wayland-nested-35.png
new file mode 100644
index 0000000..c9b246c
Binary files /dev/null and b/tests/references/wisps-open-gnome-wayland-nested-35.png differ
diff --git a/tests/references/wisps-open-gnome-wayland-nested-36.png b/tests/references/wisps-open-gnome-wayland-nested-36.png
new file mode 100644
index 0000000..f58a196
Binary files /dev/null and b/tests/references/wisps-open-gnome-wayland-nested-36.png differ
diff --git a/tests/references/wisps-open-gnome-xsession-32.png b/tests/references/wisps-open-gnome-xsession-32.png
new file mode 100644
index 0000000..5f8f9a3
Binary files /dev/null and b/tests/references/wisps-open-gnome-xsession-32.png differ
diff --git a/tests/references/wisps-open-gnome-xsession-33.png b/tests/references/wisps-open-gnome-xsession-33.png
new file mode 100644
index 0000000..6ce4190
Binary files /dev/null and b/tests/references/wisps-open-gnome-xsession-33.png differ
diff --git a/tests/references/wisps-open-gnome-xsession-34.png b/tests/references/wisps-open-gnome-xsession-34.png
new file mode 100644
index 0000000..a2a5254
Binary files /dev/null and b/tests/references/wisps-open-gnome-xsession-34.png differ
diff --git a/tests/references/wisps-open-gnome-xsession-35.png b/tests/references/wisps-open-gnome-xsession-35.png
new file mode 100644
index 0000000..a2a5254
Binary files /dev/null and b/tests/references/wisps-open-gnome-xsession-35.png differ
diff --git a/tests/references/wisps-open-gnome-xsession-36.png b/tests/references/wisps-open-gnome-xsession-36.png
new file mode 100644
index 0000000..04ca5d4
Binary files /dev/null and b/tests/references/wisps-open-gnome-xsession-36.png differ
diff --git a/tests/run-test.sh b/tests/run-test.sh
new file mode 100755
index 0000000..0e9f398
--- /dev/null
+++ b/tests/run-test.sh
@@ -0,0 +1,212 @@
+#!/bin/bash
+
+# -------------------------------------------------------------------------------------- #
+# ) ( #
+# ( /( ( ( ) ( ( ( ( )\ ) ( ( #
+# )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( #
+# ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ #
+# | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) #
+# | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< #
+# |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ #
+# |__/ #
+# Copyright (c) 2021 Simon Schneegans #
+# Released under the GPLv3 or later. See LICENSE file for details. #
+# -------------------------------------------------------------------------------------- #
+
+# This script is based on a similar script from the Fly-Pie GNOME Shell extension which is
+# published under the MIT License (https://github.com/Schneegans/Fly-Pie).
+
+# This script executes several automated tests on Burn-My-Windows. To do this, it is
+# installed in a fedora-based container running GNOME Shell on xvfb. The used container is
+# hosted on Github: https://github.com/Schneegans/gnome-shell-pod. This scripts installs
+# Burn-My-Windows from the burn-my-windows@schneegans.github.com.zip file which is
+# expected to be present in the repository root. Therefore you have to call "make" before
+# this script.
+#
+# The scripts supports two arguments:
+#
+# -v fedora_version: This determines the version of GNOME Shell to test agains.
+# -v 32: GNOME Shell 3.36
+# -v 33: GNOME Shell 3.38
+# -v 34: GNOME Shell 40
+# -v 35: GNOME Shell 41
+# -s session: This can either be "gnome-xsession" or "gnome-wayland-nested".
+
+# Exit on error.
+set -e
+
+usage() {
+ echo "Usage: $0 -v fedora_version -s session" >&2
+}
+
+FEDORA_VERSION=33
+SESSION="gnome-xsession"
+
+while getopts "v:s:h" opt; do
+ case $opt in
+ v) FEDORA_VERSION="${OPTARG}";;
+ s) SESSION="${OPTARG}";;
+ h) usage; exit 0;;
+ *) usage; exit 1;;
+ esac
+done
+
+# Go to the repo root.
+cd "$( cd "$( dirname "$0" )" && pwd )/.." || \
+ { echo "ERROR: Could not find the repo root."; exit 1; }
+
+IMAGE="ghcr.io/schneegans/gnome-shell-pod-${FEDORA_VERSION}"
+EXTENSION="burn-my-windows@schneegans.github.com"
+
+# All references images of the effects are captured at & cropped to this region
+# in the center of the screen. This is kind of arbitrary, but has been choosen so that
+# something is visible from each effect.
+CROP="100x100+910+480"
+
+# Run the container. For more info, visit https://github.com/Schneegans/gnome-shell-pod.
+POD=$(podman run --rm --cap-add=SYS_NICE --cap-add=IPC_LOCK -td "${IMAGE}")
+
+# Create a temporary directory.
+WORK_DIR=$(mktemp -d)
+if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then
+ echo "Failed to create tmp directory!" >&2
+ exit 1
+fi
+
+# Properly shutdown podman when this script is exited.
+quit() {
+ rm -r "${WORK_DIR}"
+ podman kill "${POD}"
+ wait
+}
+
+trap quit INT TERM EXIT
+
+# -------------------------------------------------------------------------------- methods
+
+# This function is used below to execute any shell command inside the running container.
+do_in_pod() {
+ podman exec --user gnomeshell --workdir /home/gnomeshell "${POD}" set-env.sh "$@"
+}
+
+# This is called whenever a test fails. It prints an error message (given as first
+# parameter), captures a screenshot to "fail.png" and stores a log in "fail.log".
+fail() {
+ echo "${1}"
+ podman cp "${POD}:/opt/Xvfb_screen0" - | tar xf - --to-command 'convert xwd:- fail.png'
+ LOG=$(do_in_pod sudo journalctl)
+ echo "${LOG}" > fail.log
+ exit 1
+}
+
+# This captures the center of the virtual screen in the container and cmopares it to the
+# given target image (first parameter). If it is not found, an error message (second
+# paramter) is printed and the script exits via the fail() method above.
+compare_with_target() {
+ echo "Looking for ${1} on the screen."
+
+ do_in_pod import -window root -crop $CROP out.png
+ podman cp "${POD}":/home/gnomeshell/out.png "${WORK_DIR}/out.png"
+
+ DIFF=$(compare "${WORK_DIR}/out.png" "${1}" -metric NCC "${WORK_DIR}/diff.png" 2>&1) || true
+
+ if (( $(echo "$DIFF < 0.9" |bc -l) )); then
+ fail "${2}"
+ fi
+}
+
+# This simulates the given keystroke in the container. Simply calling "xdotool key $1"
+# sometimes fails to be recognized. Maybe the default 12ms between key-down and key-up
+# are too short for xvfb...
+send_keystroke() {
+ do_in_pod xdotool keydown "${1}"
+ sleep 0.5
+ do_in_pod xdotool keyup "${1}"
+}
+
+# This can be used to set a gsettings key of the extension.
+set_setting() {
+ do_in_pod gsettings --schemadir /home/gnomeshell/.local/share/gnome-shell/extensions/burn-my-windows@schneegans.github.com/schemas \
+ set org.gnome.shell.extensions.burn-my-windows "${1}" "${2}"
+}
+
+# This opens the extensions preferences dialog and captures two images: One during the
+# window-open animation, and one during the window-close animation. For each capture, a
+# reference image is searched. The sleeps are a bit excessive, but it's difficult to get
+# consistent results with shorter sleeps. The animations are shown for five seconds, so
+# we also have to make sure that one animation is finished before starting the next one.
+test_effect() {
+ echo "Testing ${1} effect."
+
+ set_setting "open-preview-effect" "${1}"
+ set_setting "close-preview-effect" "${1}"
+
+ sleep 2
+ do_in_pod gnome-extensions prefs "${EXTENSION}"
+ sleep 2
+ compare_with_target "tests/references/${1}-open-${SESSION}-${FEDORA_VERSION}.png" "Failed to test ${1} window open effect!"
+ send_keystroke "Alt+F4"
+ sleep 2
+ compare_with_target "tests/references/${1}-close-${SESSION}-${FEDORA_VERSION}.png" "Failed to test ${1} window close effect!"
+ sleep 2
+}
+
+# ----------------------------------------------------- wait for the container to start up
+
+echo "Waiting for D-Bus."
+do_in_pod wait-user-bus.sh > /dev/null 2>&1
+
+
+# ----------------------------------------------------- install the to-be-tested extension
+
+echo "Installing extension."
+podman cp "${EXTENSION}.zip" "${POD}:/home/gnomeshell"
+do_in_pod gnome-extensions install "${EXTENSION}.zip"
+
+
+# ---------------------------------------------------------------------- start GNOME Shell
+
+# Starting with GNOME 40, there is a "Welcome Tour" dialog popping up at first launch.
+# We disable this beforehand.
+if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
+ echo "Disabling welcome tour."
+ do_in_pod gsettings set org.gnome.shell welcome-dialog-last-shown-version "999" || true
+fi
+
+echo "Starting $(do_in_pod gnome-shell --version)."
+do_in_pod systemctl --user start "${SESSION}@:99"
+sleep 10
+
+# Enable the extension.
+do_in_pod gnome-extensions enable "${EXTENSION}"
+
+# Starting with GNOME 40, the overview is the default mode. We close this here by hitting
+# the super key.
+if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
+ echo "Closing Overview."
+ send_keystroke "super"
+fi
+
+# Wait until the extension is enabled and the overview closed.
+sleep 3
+
+# ---------------------------------------------------------------------- perform the tests
+
+# The test mode ensures that the animations are "frozen" and do not change in time.
+echo "Entering test mode."
+set_setting "test-mode" true
+do_in_pod gsettings set org.gnome.mutter center-new-windows true
+
+test_effect "energize-a"
+test_effect "energize-b"
+test_effect "fire"
+test_effect "tv"
+test_effect "wisps"
+
+if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
+ test_effect "trex"
+ test_effect "broken-glass"
+ test_effect "matrix"
+fi
+
+echo "All tests executed successfully."