def test_systray_reconfigure_screens(manager_nospawn, minimal_conf_noscreen, backend_name):
    """Check systray does not crash when reconfiguring screens."""
    if backend_name == "wayland":
        pytest.skip("Skipping test on Wayland.")

    assert not widget.Systray._instances
    config = minimal_conf_noscreen
    config.screens = [libqtile.config.Screen(top=libqtile.bar.Bar([widget.Systray()], 10))]

    manager_nospawn.start(config)

    assert manager_nospawn.c.bar["top"].info()["widgets"][0]["name"] == "systray"

    manager_nospawn.c.reconfigure_screens()

    assert manager_nospawn.c.bar["top"].info()["widgets"][0]["name"] == "systray"
Check systray does not crash when reconfiguring screens.
test/widgets/test_systray.py