feat: improve session switching, fractional DPI/GTK theming, XDG launcher, CPU/RAM status, and power policy
This commit is contained in:
1 parent
72b05b650e
commit
07d9134d2d
28 files changed
+2670
-302
No files matched your search
@@ -191,6 +191,50 @@ def test_directives_includes_once_and_reload():
|
||||
kill_pids_from_file(m_once_skip)
|
||||
|
||||
|
||||
def test_exec_once_session_isolation():
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
env, _, xdg_home, _, _, bin_dir = make_base_env(tmp)
|
||||
conf_dir = os.path.join(xdg_home, "anode")
|
||||
sess_bin = os.path.join(bin_dir, "anode_sess_once")
|
||||
compile_sleep_dummy(sess_bin)
|
||||
|
||||
m_dead = os.path.join(tmp, "dead_sess.pid")
|
||||
m_live = os.path.join(tmp, "live_sess.pid")
|
||||
|
||||
dead_env = dict(env)
|
||||
dead_env["XDG_SESSION_ID"] = "anode-dead-session-999"
|
||||
dead_env["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=/tmp/anode-dead-dbus-999"
|
||||
|
||||
live_env = dict(env)
|
||||
live_env["XDG_SESSION_ID"] = "anode-live-session-1"
|
||||
live_env["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=/tmp/anode-live-dbus-1"
|
||||
|
||||
dead_proc = subprocess.Popen([sess_bin, m_dead], env=dead_env)
|
||||
try:
|
||||
assert wait_until(lambda: os.path.exists(m_dead), timeout=3.0)
|
||||
write_text(os.path.join(conf_dir, "autostart"), f"exec_once anode_sess_once '{m_live}'\n")
|
||||
|
||||
res1 = run_autostart(["start"], live_env)
|
||||
assert res1.returncode == 0, res1.stderr
|
||||
assert wait_until(lambda: os.path.exists(m_live), timeout=4.0), (
|
||||
"exec_once was blocked by stale process from another session"
|
||||
)
|
||||
|
||||
# Re-running start within the same session must still deduplicate
|
||||
res2 = run_autostart(["start"], live_env)
|
||||
assert res2.returncode == 0, res2.stderr
|
||||
time.sleep(0.35)
|
||||
with open(m_live, "r", encoding="utf-8") as f:
|
||||
pids = [line.strip() for line in f if line.strip()]
|
||||
assert len(pids) == 1, f"exec_once duplicated within same session: {pids}"
|
||||
finally:
|
||||
if dead_proc.poll() is None:
|
||||
dead_proc.terminate()
|
||||
dead_proc.wait(timeout=2)
|
||||
kill_pids_from_file(m_live)
|
||||
kill_pids_from_file(m_dead)
|
||||
|
||||
|
||||
def test_profiles():
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
env, _, xdg_home, _, _, _ = make_base_env(tmp)
|
||||
@@ -470,6 +514,7 @@ def test_dwm_sighup_reload_xvfb():
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_directives_includes_once_and_reload()
|
||||
test_exec_once_session_isolation()
|
||||
test_profiles()
|
||||
test_dropins_desktop_filters_and_xdg_masking()
|
||||
test_check_errors()
|
||||
|
||||
Reference in new issue
Block a user