Skip to content

Commit 91b9081

Browse files
fix cursor hiding
1 parent 88836aa commit 91b9081

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

desktop/src/cef/internal/display_handler.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ impl<H: CefEventHandler> ImplDisplayHandler for DisplayHandlerImpl<H> {
7878
CT_PROGRESS => CursorIcon::Progress,
7979
CT_NODROP => CursorIcon::NoDrop,
8080
CT_COPY => CursorIcon::Copy,
81-
CT_NONE => CursorIcon::Default,
8281
CT_NOTALLOWED => CursorIcon::NotAllowed,
8382
CT_ZOOMIN => CursorIcon::ZoomIn,
8483
CT_ZOOMOUT => CursorIcon::ZoomOut,
@@ -91,6 +90,10 @@ impl<H: CefEventHandler> ImplDisplayHandler for DisplayHandlerImpl<H> {
9190
CT_DND_COPY => CursorIcon::Copy,
9291
CT_DND_LINK => CursorIcon::Alias,
9392
CT_NUM_VALUES => CursorIcon::Default,
93+
CT_NONE => {
94+
self.event_handler.cursor_change(crate::window::Cursor::None);
95+
return 1; // We handled the cursor change.
96+
}
9497
_ => CursorIcon::Default,
9598
};
9699

desktop/src/window.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,12 @@ impl Window {
169169
};
170170
custom_cursor.into()
171171
}
172+
Cursor::None => {
173+
self.winit_window.set_cursor_visible(false);
174+
return;
175+
}
172176
};
177+
self.winit_window.set_cursor_visible(true);
173178
self.winit_window.set_cursor(cursor);
174179
}
175180

@@ -215,6 +220,7 @@ impl Window {
215220
pub(crate) enum Cursor {
216221
Icon(CursorIcon),
217222
Custom(CustomCursorSource),
223+
None,
218224
}
219225
impl From<CursorIcon> for Cursor {
220226
fn from(icon: CursorIcon) -> Self {

0 commit comments

Comments
 (0)