Skip to content

Commit

Permalink
servoshell: Support Cursor::None and all winit keys (#32228)
Browse files Browse the repository at this point in the history
keyboard-types has been bumped to 0.7, and stylo bumped to latest main
(as of 2024-05-05) for their bump to kbd-types 0.7.
  • Loading branch information
Nopey committed May 13, 2024
1 parent 385f6f9 commit c0494e2
Show file tree
Hide file tree
Showing 4 changed files with 482 additions and 103 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ipc-channel = "0.18"
itertools = "0.12"
jemalloc-sys = "0.5.4"
jemallocator = "0.5.4"
keyboard-types = "0.6"
keyboard-types = "0.7"
lazy_static = "1.4"
libc = "0.2"
log = "0.4"
Expand Down
6 changes: 5 additions & 1 deletion ports/servoshell/headed_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,13 @@ impl WindowPortsMethods for Window {
Cursor::AllScroll => CursorIcon::AllScroll,
Cursor::ZoomIn => CursorIcon::ZoomIn,
Cursor::ZoomOut => CursorIcon::ZoomOut,
_ => CursorIcon::Default,
Cursor::None => {
self.winit_window.set_cursor_visible(false);
return;
},
};
self.winit_window.set_cursor_icon(winit_cursor);
self.winit_window.set_cursor_visible(true);
}

fn is_animating(&self) -> bool {
Expand Down

0 comments on commit c0494e2

Please sign in to comment.