diff --git a/tests/dummy-app.js b/tests/dummy-app.js index 29d8325dc..d71616aca 100755 --- a/tests/dummy-app.js +++ b/tests/dummy-app.js @@ -6,9 +6,10 @@ 'use strict'; +imports.gi.versions.Gdk = '4.0'; imports.gi.versions.Gtk = '4.0'; -const { GObject, Gio, Gtk } = imports.gi; +const { GObject, Gio, Gdk, Gtk } = imports.gi; const System = imports.system; @@ -19,6 +20,8 @@ const Application = GObject.registerClass({ this.connect('startup', this.startup.bind(this)); this.connect('activate', this.activate.bind(this)); + + Gdk.set_allowed_backends('x11'); } startup() { diff --git a/tests/fixtures.py b/tests/fixtures.py index 36970ee80..1bf5f990b 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -457,6 +457,19 @@ def shell_init( shell_test_hook.SetPointer(pointer_x, center_y) shell_test_hook.SetPointer(center_x, center_y) + @pytest.fixture(scope='class') + def shell_env( + self, + shell_init, + shell_test_hook + ): + shell_environ = shell_test_hook.Eval('imports.gi.GLib.get_environ()') + + return { + k: v for k, _, v in + (entry.partition('=') for entry in shell_environ) + } + @pytest.fixture(scope='class') def extension_init(self, shell_init, shell_extensions_dbus_interface): return shell_extensions_dbus_interface.EnableExtension('ddterm@amezin.github.com') @@ -592,13 +605,14 @@ def dummy_app( process_launcher, dbus_connection, shell_test_hook, + shell_env, hide_overview, pytestconfig, ): with process_launcher.spawn( str(pytestconfig.option.gjs), str(THIS_DIR / 'dummy-app.js'), - env=dbus_environment, + env=shell_env, ) as proc: try: shell_test_hook.wait_property('FocusApp', 'com.github.ddterm.DummyApp') diff --git a/tests/test_wm.py b/tests/test_wm.py index 830902881..783118f52 100644 --- a/tests/test_wm.py +++ b/tests/test_wm.py @@ -931,8 +931,9 @@ def initial_monitor_layout(self): return [] @pytest.fixture(scope='class') - def shell_init(self, disable_extension_updates): - pass + def shell_init(self, disable_extension_updates, shell_dbus_interface): + if shell_dbus_interface.ShellVersion == (47, 10): + pytest.skip('Sometimes crashes GNOME Shell on Fedora 41') def test_smoke(self, extension_init): pass