wayland: implement wl_touch
Co-authored-by: Julian Orth <ju.orth@gmail.com>
This commit is contained in:
parent
905e2dd7ba
commit
681c1ad033
35 changed files with 1071 additions and 52 deletions
|
|
@ -376,6 +376,7 @@ struct InputDeviceProperties {
|
|||
drag_enabled: Cell<Option<bool>>,
|
||||
drag_lock_enabled: Cell<Option<bool>>,
|
||||
natural_scrolling_enabled: Cell<Option<bool>>,
|
||||
calibration_matrix: Cell<Option<[[f32; 3]; 2]>>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
@ -436,6 +437,9 @@ impl MetalInputDevice {
|
|||
if let Some(enabled) = self.desired.natural_scrolling_enabled.get() {
|
||||
self.set_natural_scrolling_enabled(enabled);
|
||||
}
|
||||
if let Some(lh) = self.desired.calibration_matrix.get() {
|
||||
self.set_calibration_matrix(lh);
|
||||
}
|
||||
self.fetch_effective();
|
||||
}
|
||||
|
||||
|
|
@ -465,6 +469,11 @@ impl MetalInputDevice {
|
|||
.natural_scrolling_enabled
|
||||
.set(Some(device.natural_scrolling_enabled()));
|
||||
}
|
||||
if device.has_calibration_matrix() {
|
||||
self.effective
|
||||
.calibration_matrix
|
||||
.set(Some(device.get_calibration_matrix()));
|
||||
}
|
||||
}
|
||||
|
||||
fn pre_pause(&self) {
|
||||
|
|
@ -721,6 +730,22 @@ impl InputDevice for MetalInputDevice {
|
|||
groups,
|
||||
}))
|
||||
}
|
||||
|
||||
fn calibration_matrix(&self) -> Option<[[f32; 3]; 2]> {
|
||||
self.effective.calibration_matrix.get()
|
||||
}
|
||||
|
||||
fn set_calibration_matrix(&self, m: [[f32; 3]; 2]) {
|
||||
self.desired.calibration_matrix.set(Some(m));
|
||||
if let Some(dev) = self.inputdev.get() {
|
||||
if dev.device().has_calibration_matrix() {
|
||||
dev.device().set_calibration_matrix(m);
|
||||
self.effective
|
||||
.calibration_matrix
|
||||
.set(Some(dev.device().get_calibration_matrix()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl MetalInputDevice {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue