1
0
Fork 0
forked from wry/wry

tree: never focus wl-subsurface surfaces

This commit is contained in:
Julian Orth 2022-05-05 14:04:15 +02:00
parent 5afde58086
commit 4584dee160
15 changed files with 150 additions and 35 deletions

View file

@ -234,6 +234,19 @@ impl Connector for TestConnector {
}
}
pub struct TestMouseClick {
pub mouse: Rc<TestBackendMouse>,
pub button: u32,
}
impl Drop for TestMouseClick {
fn drop(&mut self) {
self.mouse
.common
.event(InputEvent::Button(self.button, KeyState::Released));
}
}
pub struct TestBackendMouse {
pub common: TestInputDeviceCommon,
pub transform_matrix: Cell<TransformMatrix>,
@ -252,6 +265,15 @@ impl TestBackendMouse {
dy_unaccelerated: Fixed::from_f64(dy),
})
}
pub fn click(self: &Rc<Self>, button: u32) -> TestMouseClick {
self.common
.event(InputEvent::Button(button, KeyState::Pressed));
TestMouseClick {
mouse: self.clone(),
button,
}
}
}
pub struct TestBackendKb {