tree: activate workspace on click
This commit is contained in:
parent
70cc24107b
commit
858e777f5a
7 changed files with 127 additions and 13 deletions
|
|
@ -43,6 +43,7 @@ mod t0014_container_scroll_focus;
|
|||
mod t0015_scroll_partial;
|
||||
mod t0016_scroll_ws;
|
||||
mod t0017_remove_unused_ws;
|
||||
mod t0018_click_to_active_ws;
|
||||
|
||||
pub trait TestCase: Sync {
|
||||
fn name(&self) -> &'static str;
|
||||
|
|
@ -78,5 +79,6 @@ pub fn tests() -> Vec<&'static dyn TestCase> {
|
|||
t0015_scroll_partial,
|
||||
t0016_scroll_ws,
|
||||
t0017_remove_unused_ws,
|
||||
t0018_click_to_active_ws,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
46
src/it/tests/t0018_click_to_active_ws.rs
Normal file
46
src/it/tests/t0018_click_to_active_ws.rs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
use {
|
||||
crate::{
|
||||
ifs::wl_seat::BTN_LEFT,
|
||||
it::{test_error::TestResult, testrun::TestRun},
|
||||
},
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
testcase!();
|
||||
|
||||
async fn test(run: Rc<TestRun>) -> TestResult {
|
||||
let ds = run.create_default_setup().await?;
|
||||
run.cfg.show_workspace(ds.seat.id(), "1")?;
|
||||
|
||||
let client = run.create_client().await?;
|
||||
|
||||
let win1 = client.create_window().await?;
|
||||
win1.map().await?;
|
||||
|
||||
run.cfg.show_workspace(ds.seat.id(), "2")?;
|
||||
|
||||
let win2 = client.create_window().await?;
|
||||
win2.map().await?;
|
||||
|
||||
ds.mouse.abs(&ds.connector, 0.0, 0.0);
|
||||
ds.mouse.click(BTN_LEFT);
|
||||
|
||||
client.sync().await;
|
||||
|
||||
let name = ds.output.workspace.get().map(|ws| ws.name.clone());
|
||||
tassert_eq!(name.as_deref(), Some("1"));
|
||||
|
||||
let pos = {
|
||||
let rd = ds.output.render_data.borrow_mut();
|
||||
rd.titles.last().map(|t| t.x1).unwrap_or(0)
|
||||
};
|
||||
ds.mouse.abs(&ds.connector, pos as _, 0.0);
|
||||
ds.mouse.click(BTN_LEFT);
|
||||
|
||||
client.sync().await;
|
||||
|
||||
let name = ds.output.workspace.get().map(|ws| ws.name.clone());
|
||||
tassert_eq!(name.as_deref(), Some("2"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue