mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 14:50:04 -04:00
chore: fix typos
This commit is contained in:
@@ -501,7 +501,7 @@ unsafe impl rwh_05::HasRawDisplayHandle for ActiveEventLoop {
|
|||||||
|
|
||||||
/// A proxy for the underlying display handle.
|
/// A proxy for the underlying display handle.
|
||||||
///
|
///
|
||||||
/// The purpose of this type is to provide a cheaply clonable handle to the underlying
|
/// The purpose of this type is to provide a cheaply cloneable handle to the underlying
|
||||||
/// display handle. This is often used by graphics APIs to connect to the underlying APIs.
|
/// display handle. This is often used by graphics APIs to connect to the underlying APIs.
|
||||||
/// It is difficult to keep a handle to the [`EventLoop`] type or the [`ActiveEventLoop`]
|
/// It is difficult to keep a handle to the [`EventLoop`] type or the [`ActiveEventLoop`]
|
||||||
/// type. In contrast, this type involves no lifetimes and can be persisted for as long as
|
/// type. In contrast, this type involves no lifetimes and can be persisted for as long as
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ impl fmt::Display for BadAnimation {
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::Empty => write!(f, "No cursors supplied"),
|
Self::Empty => write!(f, "No cursors supplied"),
|
||||||
Self::Animation => write!(f, "A supplied cursor is an animtion"),
|
Self::Animation => write!(f, "A supplied cursor is an animation"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ pub struct Sender<T>(Arc<SenderInner<T>>);
|
|||||||
struct SenderInner<T> {
|
struct SenderInner<T> {
|
||||||
// We need to wrap it into a `Mutex` to make it `Sync`. So the sender can't
|
// We need to wrap it into a `Mutex` to make it `Sync`. So the sender can't
|
||||||
// be accessed on the main thread, as it could block. Additionally we need
|
// be accessed on the main thread, as it could block. Additionally we need
|
||||||
// to wrap `Sender` in an `Arc` to make it clonable on the main thread without
|
// to wrap `Sender` in an `Arc` to make it cloneable on the main thread without
|
||||||
// having to block.
|
// having to block.
|
||||||
sender: Mutex<mpsc::Sender<T>>,
|
sender: Mutex<mpsc::Sender<T>>,
|
||||||
shared: Arc<Shared>,
|
shared: Arc<Shared>,
|
||||||
|
|||||||
@@ -377,19 +377,19 @@ impl<T> BufferedEvent<T> {
|
|||||||
match self {
|
match self {
|
||||||
Self::Event(event) => dispatch(event),
|
Self::Event(event) => dispatch(event),
|
||||||
Self::ScaleFactorChanged(window_id, scale_factor, new_inner_size) => {
|
Self::ScaleFactorChanged(window_id, scale_factor, new_inner_size) => {
|
||||||
let user_new_innner_size = Arc::new(Mutex::new(new_inner_size));
|
let user_new_inner_size = Arc::new(Mutex::new(new_inner_size));
|
||||||
dispatch(Event::WindowEvent {
|
dispatch(Event::WindowEvent {
|
||||||
window_id,
|
window_id,
|
||||||
event: WindowEvent::ScaleFactorChanged {
|
event: WindowEvent::ScaleFactorChanged {
|
||||||
scale_factor,
|
scale_factor,
|
||||||
inner_size_writer: InnerSizeWriter::new(Arc::downgrade(
|
inner_size_writer: InnerSizeWriter::new(Arc::downgrade(
|
||||||
&user_new_innner_size,
|
&user_new_inner_size,
|
||||||
)),
|
)),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
let inner_size = *user_new_innner_size.lock().unwrap();
|
let inner_size = *user_new_inner_size.lock().unwrap();
|
||||||
|
|
||||||
drop(user_new_innner_size);
|
drop(user_new_inner_size);
|
||||||
|
|
||||||
if inner_size != new_inner_size {
|
if inner_size != new_inner_size {
|
||||||
let window_flags = unsafe {
|
let window_flags = unsafe {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ impl KeyEventBuilder {
|
|||||||
MatchResult::MessagesToDispatch(self.pending.complete_multi(key_events))
|
MatchResult::MessagesToDispatch(self.pending.complete_multi(key_events))
|
||||||
},
|
},
|
||||||
WM_KILLFOCUS => {
|
WM_KILLFOCUS => {
|
||||||
// sythesize keyup events
|
// synthesize keyup events
|
||||||
let kbd_state = get_kbd_state();
|
let kbd_state = get_kbd_state();
|
||||||
let key_events = Self::synthesize_kbd_state(ElementState::Released, &kbd_state);
|
let key_events = Self::synthesize_kbd_state(ElementState::Released, &kbd_state);
|
||||||
MatchResult::MessagesToDispatch(self.pending.complete_multi(key_events))
|
MatchResult::MessagesToDispatch(self.pending.complete_multi(key_events))
|
||||||
@@ -334,11 +334,11 @@ impl KeyEventBuilder {
|
|||||||
// We are synthesizing the press event for caps-lock first for the following reasons:
|
// We are synthesizing the press event for caps-lock first for the following reasons:
|
||||||
// 1. If caps-lock is *not* held down but *is* active, then we have to synthesize all
|
// 1. If caps-lock is *not* held down but *is* active, then we have to synthesize all
|
||||||
// printable keys, respecting the caps-lock state.
|
// printable keys, respecting the caps-lock state.
|
||||||
// 2. If caps-lock is held down, we could choose to sythesize its keypress after every other
|
// 2. If caps-lock is held down, we could choose to synthesize its keypress after every
|
||||||
// key, in which case all other keys *must* be sythesized as if the caps-lock state was
|
// other key, in which case all other keys *must* be sythesized as if the caps-lock state
|
||||||
// be the opposite of what it currently is.
|
// was be the opposite of what it currently is.
|
||||||
// --
|
// --
|
||||||
// For the sake of simplicity we are choosing to always sythesize
|
// For the sake of simplicity we are choosing to always synthesize
|
||||||
// caps-lock first, and always use the current caps-lock state
|
// caps-lock first, and always use the current caps-lock state
|
||||||
// to determine the produced text
|
// to determine the produced text
|
||||||
if is_key_pressed!(VK_CAPITAL) {
|
if is_key_pressed!(VK_CAPITAL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user