Skip to content

Commit

Permalink
Add a warning about UI animations.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Feb 25, 2023
1 parent a07ebde commit e6c3096
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ jobs:

- backend: linux
runs-on: ubuntu-latest
pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config libfuse2"
pre-command: |
sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config libfuse2
gsettings set org.gnome.desktop.interface enable-animations false
briefcase-run-prefix: 'xvfb-run -a -s "-screen 0 2048x1536x24"'

- backend: windows
Expand Down
13 changes: 12 additions & 1 deletion gtk/tests_backend/widgets/base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import asyncio
import warnings

from pytest import skip

from toga_gtk.libs import Gtk
from toga_gtk.libs import Gio, Gtk

from .properties import toga_color, toga_font

Expand All @@ -14,6 +15,16 @@ def __init__(self, widget):
self.native = widget._impl.native
assert isinstance(self.native, self.native_class)

# Check if GTK UI animations are enabled.
settings = Gio.Settings(schema="org.gnome.desktop.interface")
if settings.get_boolean("enable-animations"):
warnings.warn(
"GTK UI animations are enabled; any tests failures are likely "
"caused by this. Run `gsettings set org.gnome.desktop.interface "
"enable-animations false` to disable animations.",
RuntimeWarning,
)

def assert_container(self, container):
container_native = container._impl.container
for control in container_native.get_children():
Expand Down

0 comments on commit e6c3096

Please sign in to comment.