-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree: focus float nodes when switching workspaces
- Loading branch information
1 parent
206a2ed
commit a81e2d6
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use { | ||
crate::{ | ||
it::{test_error::TestError, testrun::TestRun}, | ||
tree::ToplevelNodeBase, | ||
}, | ||
std::rc::Rc, | ||
}; | ||
|
||
testcase!(); | ||
|
||
/// Test that container focus is set to a lone stacked window when switching to its workspace | ||
async fn test(run: Rc<TestRun>) -> Result<(), TestError> { | ||
let ds = run.create_default_setup().await?; | ||
let client = run.create_client().await?; | ||
|
||
run.cfg.show_workspace(ds.seat.id(), "1")?; | ||
let win1 = client.create_window().await?; | ||
win1.map().await?; | ||
client.sync().await; | ||
run.cfg.set_floating(ds.seat.id(), true)?; | ||
|
||
run.cfg.show_workspace(ds.seat.id(), "2")?; | ||
let win2 = client.create_window().await?; | ||
win2.map().await?; | ||
client.sync().await; | ||
|
||
run.cfg.show_workspace(ds.seat.id(), "1")?; | ||
|
||
let container = match win1.tl.server.tl_data().parent.get() { | ||
Some(p) => match p.node_into_float() { | ||
Some(p) => p, | ||
_ => bail!("Containing node is not a float"), | ||
}, | ||
_ => bail!("Toplevel doesn't have a parent"), | ||
}; | ||
|
||
tassert!(container.active.get()); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters