Fall back to Pointer cursor for slider widget on Windows

Co-authored-by: dtzxporter <dtzxporter@users.noreply.github.com>
This commit is contained in:
Héctor Ramón Jiménez 2025-11-29 15:12:26 +01:00
parent 39ca9e0233
commit c469dc8a0b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 24 additions and 4 deletions

View file

@ -533,9 +533,19 @@ where
let state = tree.state.downcast_ref::<State>();
if state.is_dragging {
mouse::Interaction::Grabbing
// FIXME: Fall back to `Pointer` on Windows
// See https://github.com/rust-windowing/winit/issues/1043
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grabbing
}
} else if cursor.is_over(layout.bounds()) {
mouse::Interaction::Grab
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grab
}
} else {
mouse::Interaction::default()
}

View file

@ -525,9 +525,19 @@ where
let state = tree.state.downcast_ref::<State>();
if state.is_dragging {
mouse::Interaction::Grabbing
// FIXME: Fall back to `Pointer` on Windows
// See https://github.com/rust-windowing/winit/issues/1043
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grabbing
}
} else if cursor.is_over(layout.bounds()) {
mouse::Interaction::Grab
if cfg!(target_os = "windows") {
mouse::Interaction::Pointer
} else {
mouse::Interaction::Grab
}
} else {
mouse::Interaction::default()
}