it: test dnd focus change on drop
This commit is contained in:
parent
a39031d4f9
commit
c6b34550d8
16 changed files with 421 additions and 9 deletions
51
src/it/tests/t0025_dnd_focus_change.rs
Normal file
51
src/it/tests/t0025_dnd_focus_change.rs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
use {
|
||||
crate::{
|
||||
ifs::wl_seat::BTN_LEFT,
|
||||
it::{test_error::TestResult, test_utils::test_rect_ext::TestRectExt, testrun::TestRun},
|
||||
tree::Node,
|
||||
},
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
testcase!();
|
||||
|
||||
async fn test(run: Rc<TestRun>) -> TestResult {
|
||||
let ds = run.create_default_setup().await?;
|
||||
|
||||
let client = run.create_client().await?;
|
||||
|
||||
let win1 = client.create_window().await?;
|
||||
win1.map2().await?;
|
||||
let win2 = client.create_window().await?;
|
||||
win2.map2().await?;
|
||||
|
||||
let seat = client.get_default_seat().await?;
|
||||
let button = seat.pointer.button.expect()?;
|
||||
|
||||
let (x, y) = win1.tl.server.node_absolute_position().center();
|
||||
ds.move_to(x, y);
|
||||
let click = ds.mouse.click(BTN_LEFT);
|
||||
|
||||
client.sync().await;
|
||||
let dev = client.data_device_manager.get_data_device(&seat.seat)?;
|
||||
let src = client.data_device_manager.create_data_source()?;
|
||||
src.set_actions(1)?;
|
||||
dev.start_drag(&src, &win1.surface, None, button.next()?.serial)?;
|
||||
|
||||
client.sync().await;
|
||||
let enter = seat.pointer.enter.expect()?;
|
||||
|
||||
let (x, y) = win2.tl.server.node_absolute_position().center();
|
||||
ds.move_to(x, y);
|
||||
|
||||
client.sync().await;
|
||||
tassert!(enter.next().is_err());
|
||||
|
||||
drop(click);
|
||||
|
||||
client.sync().await;
|
||||
client.sync().await;
|
||||
tassert_eq!(enter.next()?.surface, win2.surface.id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue