moving: Grab use correct cursor
This commit is contained in:
parent
da59cbd768
commit
88d8972d34
2 changed files with 22 additions and 1 deletions
|
|
@ -42,6 +42,7 @@ pub enum CursorShape {
|
|||
Default,
|
||||
ColResize,
|
||||
RowResize,
|
||||
Grab,
|
||||
}
|
||||
|
||||
impl ToString for CursorShape {
|
||||
|
|
@ -50,6 +51,7 @@ impl ToString for CursorShape {
|
|||
CursorShape::Default => "default",
|
||||
CursorShape::ColResize => "col-resize",
|
||||
CursorShape::RowResize => "row-resize",
|
||||
CursorShape::Grab => "grabbing",
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
|
|
@ -243,6 +245,10 @@ impl Default for CursorState {
|
|||
CursorShape::RowResize,
|
||||
Cursor::load(&theme, CursorShape::RowResize, size),
|
||||
);
|
||||
map.insert(
|
||||
CursorShape::Grab,
|
||||
Cursor::load(&theme, CursorShape::Grab, size),
|
||||
);
|
||||
map
|
||||
},
|
||||
current_image: RefCell::new(None),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::{
|
||||
backend::render::{element::AsGlowRenderer, IndicatorShader},
|
||||
backend::render::{
|
||||
cursor::{CursorShape, CursorState},
|
||||
element::AsGlowRenderer,
|
||||
IndicatorShader,
|
||||
},
|
||||
shell::{
|
||||
element::CosmicMappedRenderElement,
|
||||
focus::target::{KeyboardFocusTarget, PointerFocusTarget},
|
||||
|
|
@ -210,6 +214,11 @@ impl MoveGrab {
|
|||
.unwrap()
|
||||
.borrow_mut() = Some(grab_state);
|
||||
|
||||
{
|
||||
let cursor_state = seat.user_data().get::<CursorState>().unwrap();
|
||||
cursor_state.set_shape(CursorShape::Grab);
|
||||
}
|
||||
|
||||
MoveGrab {
|
||||
window,
|
||||
start_data,
|
||||
|
|
@ -303,6 +312,12 @@ impl MoveGrab {
|
|||
};
|
||||
|
||||
handle.unset_grab(state, serial, time);
|
||||
|
||||
{
|
||||
let cursor_state = self.seat.user_data().get::<CursorState>().unwrap();
|
||||
cursor_state.set_shape(CursorShape::Default);
|
||||
}
|
||||
|
||||
if self.window.alive() {
|
||||
if let Some(position) = position {
|
||||
handle.motion(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue