Add MRU focus switching between tiled and floating layers

This commit is contained in:
Samuel Onoja committed 2026-10-07 08:13:42 +01:00
1 parent ce024d4794
commit 76112b59ac
9 files changed
+364 -4

No files matched your search

+26
View File
@@ -41,6 +41,7 @@ fn help_exits_successfully_without_a_session_and_has_hidden_legacy_aliases() {
&["media", "--help"],
&["xwayland", "--help"],
&["screenshot", "--help"],
&["focus-floating", "--help"],
] {
let text = success(ctl(args).output().unwrap());
assert!(text.contains("Usage:"));
@@ -52,6 +53,31 @@ fn help_exits_successfully_without_a_session_and_has_hidden_legacy_aliases() {
assert!(error.contains("windows"), "{error}");
}
#[test]
fn focus_floating_sends_a_parameterless_action_and_rejects_cycle_arguments() {
let directory = tempfile::tempdir().unwrap();
let socket = directory.path().join("control.sock");
let listener = UnixListener::bind(&socket).unwrap();
let worker = thread::spawn(move || {
let (mut stream, _) = listener.accept().unwrap();
stream
.set_read_timeout(Some(std::time::Duration::from_secs(2)))
.unwrap();
let request: Request = read_frame(&mut stream).unwrap();
assert_eq!(request.command, "focus-floating");
assert_eq!(request.args, json!({}));
write_frame(&mut stream, &Response::success(request.id, json!({}))).unwrap();
});
success(
ctl(&["--socket", socket.to_str().unwrap(), "focus-floating"])
.output()
.unwrap(),
);
worker.join().unwrap();
let output = ctl(&["focus-floating", "next"]).output().unwrap();
assert_eq!(output.status.code(), Some(2));
}
#[test]
fn explicit_socket_targets_the_nested_instance_for_queries_and_theme_commands() {
let directory = tempfile::tempdir().unwrap();