Skip to content

Commit

Permalink
Use a programmatic approach to disable animations.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Feb 21, 2023
1 parent acd3819 commit f7a1006
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ 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
gsettings set org.gnome.desktop.interface enable-animations false
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
briefcase-run-prefix: 'xvfb-run -a -s "-screen 0 2048x1536x24"'

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

from pytest import skip

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

from .properties import toga_color, toga_font

Expand All @@ -15,15 +14,9 @@ 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,
)
# Ensure that the theme isn't using animations for the widget.
settings = Gtk.Settings.get_for_screen(self.native.get_screen())
settings.set_property("gtk-enable-animations", False)

def assert_container(self, container):
container_native = container._impl.container
Expand Down

0 comments on commit f7a1006

Please sign in to comment.