fix: wayland stability
This commit is contained in:
@@ -88,9 +88,9 @@ impl KdeDecorationHandler for WaylandState {
|
||||
&mut self,
|
||||
_surface: &WlSurface,
|
||||
decoration: &OrgKdeKwinServerDecoration,
|
||||
_mode: WEnum<KdeMode>,
|
||||
mode: WEnum<KdeMode>,
|
||||
) {
|
||||
decoration.mode(KdeMode::Server);
|
||||
decoration.mode(mode.into_result().unwrap());
|
||||
}
|
||||
}
|
||||
delegate_kde_decoration!(WaylandState);
|
||||
|
||||
@@ -148,7 +148,9 @@ impl SurfaceInfo {
|
||||
pos.x.clamp(0.0, focus_size.x as f64),
|
||||
pos.y.clamp(0.0, focus_size.y as f64),
|
||||
);
|
||||
pointer.frame();
|
||||
if pointer.version() >= wl_pointer::EVT_FRAME_SINCE {
|
||||
pointer.frame();
|
||||
}
|
||||
}
|
||||
(true, PointerEvent::Button { button, state }) => {
|
||||
pointer.button(
|
||||
@@ -161,7 +163,9 @@ impl SurfaceInfo {
|
||||
_ => continue,
|
||||
},
|
||||
);
|
||||
pointer.frame();
|
||||
if pointer.version() >= wl_pointer::EVT_FRAME_SINCE {
|
||||
pointer.frame();
|
||||
}
|
||||
}
|
||||
(
|
||||
true,
|
||||
@@ -174,15 +178,22 @@ impl SurfaceInfo {
|
||||
pointer.axis(0, Axis::HorizontalScroll, axis_continuous.x as f64);
|
||||
pointer.axis(0, Axis::VerticalScroll, axis_continuous.y as f64);
|
||||
}
|
||||
if let Some(axis_discrete) = axis_discrete {
|
||||
pointer.axis_discrete(Axis::HorizontalScroll, axis_discrete.x as i32);
|
||||
pointer.axis_discrete(Axis::VerticalScroll, axis_discrete.y as i32);
|
||||
if pointer.version() >= wl_pointer::EVT_AXIS_DISCRETE_SINCE {
|
||||
if let Some(axis_discrete) = axis_discrete {
|
||||
pointer.axis_discrete(Axis::HorizontalScroll, axis_discrete.x as i32);
|
||||
pointer.axis_discrete(Axis::VerticalScroll, axis_discrete.y as i32);
|
||||
}
|
||||
}
|
||||
if axis_discrete.is_none() && axis_continuous.is_none() {
|
||||
if pointer.version() >= wl_pointer::EVT_AXIS_STOP_SINCE
|
||||
&& axis_discrete.is_none()
|
||||
&& axis_continuous.is_none()
|
||||
{
|
||||
pointer.axis_stop(0, Axis::HorizontalScroll);
|
||||
pointer.axis_stop(0, Axis::VerticalScroll);
|
||||
}
|
||||
pointer.frame();
|
||||
if pointer.version() >= wl_pointer::EVT_FRAME_SINCE {
|
||||
pointer.frame();
|
||||
}
|
||||
}
|
||||
(locked, event) => {
|
||||
warn!(locked, ?event, "Invalid pointer event!");
|
||||
@@ -202,7 +213,9 @@ impl SurfaceInfo {
|
||||
|
||||
if !locked {
|
||||
keyboard.enter(0, &focus, vec![]);
|
||||
keyboard.repeat_info(0, 0);
|
||||
if keyboard.version() >= wl_keyboard::EVT_REPEAT_INFO_SINCE {
|
||||
keyboard.repeat_info(0, 0);
|
||||
}
|
||||
locked = info.keymap.send(keyboard).is_ok();
|
||||
}
|
||||
while let Some(event) = self.keyboard_queue.pop_front() {
|
||||
@@ -413,7 +426,9 @@ impl Dispatch<WlSeat, Arc<SeatData>, WaylandState> for WaylandState {
|
||||
}
|
||||
wl_seat::Request::GetKeyboard { id } => {
|
||||
let keyboard = data_init.init(id, data.clone());
|
||||
keyboard.repeat_info(0, 0);
|
||||
if keyboard.version() >= wl_keyboard::EVT_REPEAT_INFO_SINCE {
|
||||
keyboard.repeat_info(0, 0);
|
||||
}
|
||||
let _ = data.keyboard.set((keyboard, Mutex::new(ObjectId::null())));
|
||||
}
|
||||
wl_seat::Request::GetTouch { id } => {
|
||||
|
||||
Reference in New Issue
Block a user