wayland: Implement cursor-shape-v1

This commit is contained in:
may 2024-09-09 16:21:27 +02:00 committed by GitHub
parent 79ae56c601
commit 0ffe6ae718
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 92 additions and 161 deletions

View file

@ -2,9 +2,8 @@
use crate::{
backend::render::{
cursor::{CursorShape, CursorState},
element::AsGlowRenderer,
BackdropShader, IndicatorShader, Key, SplitRenderElements, Usage,
cursor::CursorState, element::AsGlowRenderer, BackdropShader, IndicatorShader, Key,
SplitRenderElements, Usage,
},
shell::{
element::{
@ -32,7 +31,7 @@ use smithay::{
desktop::{layer_map_for_output, space::SpaceElement},
input::{
pointer::{
AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent,
AxisFrame, ButtonEvent, CursorIcon, GestureHoldBeginEvent, GestureHoldEndEvent,
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent,
GrabStartData as PointerGrabStartData, MotionEvent, PointerGrab, PointerInnerHandle,
@ -710,7 +709,7 @@ impl MoveGrab {
{
let cursor_state = seat.user_data().get::<CursorState>().unwrap();
cursor_state.lock().unwrap().set_shape(CursorShape::Grab);
cursor_state.lock().unwrap().set_shape(CursorIcon::Grab);
}
MoveGrab {
@ -850,7 +849,7 @@ impl Drop for MoveGrab {
{
let cursor_state = seat.user_data().get::<CursorState>().unwrap();
cursor_state.lock().unwrap().set_shape(CursorShape::Default);
cursor_state.lock().unwrap().unset_shape();
}
if let Some((mapped, position)) = position {