mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Compare commits
3 Commits
madsmtm/ch
...
v0.28.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
546ab7575e | ||
|
|
3e258a377f | ||
|
|
e5260da95b |
@@ -8,6 +8,12 @@ And please only add new entries to the top of this list, right below the `# Unre
|
|||||||
|
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
# 0.28.1
|
||||||
|
|
||||||
|
- On Wayland, fix crash when dropping a window in multi-window setup.
|
||||||
|
|
||||||
|
# 0.28.0
|
||||||
|
|
||||||
- On macOS, fixed `Ime::Commit` persisting for all input after interacting with `Ime`.
|
- On macOS, fixed `Ime::Commit` persisting for all input after interacting with `Ime`.
|
||||||
- On macOS, added `WindowExtMacOS::option_as_alt` and `WindowExtMacOS::set_option_as_alt`.
|
- On macOS, added `WindowExtMacOS::option_as_alt` and `WindowExtMacOS::set_option_as_alt`.
|
||||||
- On Windows, fix window size for maximized, undecorated windows.
|
- On Windows, fix window size for maximized, undecorated windows.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "winit"
|
name = "winit"
|
||||||
version = "0.27.5"
|
version = "0.28.1"
|
||||||
authors = ["The winit contributors", "Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
authors = ["The winit contributors", "Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||||
description = "Cross-platform window creation library."
|
description = "Cross-platform window creation library."
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
winit = "0.27.5"
|
winit = "0.28.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
## [Documentation](https://docs.rs/winit)
|
## [Documentation](https://docs.rs/winit)
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ pub(super) fn handle_keyboard(
|
|||||||
KeyboardEvent::Enter { surface, .. } => {
|
KeyboardEvent::Enter { surface, .. } => {
|
||||||
let window_id = wayland::make_wid(&surface);
|
let window_id = wayland::make_wid(&surface);
|
||||||
|
|
||||||
let window_handle = winit_state.window_map.get_mut(&window_id).unwrap();
|
let window_handle = match winit_state.window_map.get_mut(&window_id) {
|
||||||
|
Some(window_handle) => window_handle,
|
||||||
|
None => return,
|
||||||
|
};
|
||||||
window_handle.has_focus.store(true, Ordering::Relaxed);
|
window_handle.has_focus.store(true, Ordering::Relaxed);
|
||||||
|
|
||||||
// Window gained focus.
|
// Window gained focus.
|
||||||
@@ -39,7 +42,14 @@ pub(super) fn handle_keyboard(
|
|||||||
inner.target_window_id = Some(window_id);
|
inner.target_window_id = Some(window_id);
|
||||||
}
|
}
|
||||||
KeyboardEvent::Leave { surface, .. } => {
|
KeyboardEvent::Leave { surface, .. } => {
|
||||||
|
// Reset the id.
|
||||||
|
inner.target_window_id = None;
|
||||||
|
|
||||||
let window_id = wayland::make_wid(&surface);
|
let window_id = wayland::make_wid(&surface);
|
||||||
|
let window_handle = match winit_state.window_map.get_mut(&window_id) {
|
||||||
|
Some(window_handle) => window_handle,
|
||||||
|
None => return,
|
||||||
|
};
|
||||||
|
|
||||||
// Notify that no modifiers are being pressed.
|
// Notify that no modifiers are being pressed.
|
||||||
if !inner.modifiers_state.borrow().is_empty() {
|
if !inner.modifiers_state.borrow().is_empty() {
|
||||||
@@ -49,14 +59,10 @@ pub(super) fn handle_keyboard(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let window_handle = winit_state.window_map.get_mut(&window_id).unwrap();
|
|
||||||
window_handle.has_focus.store(false, Ordering::Relaxed);
|
window_handle.has_focus.store(false, Ordering::Relaxed);
|
||||||
|
|
||||||
// Window lost focus.
|
// Window lost focus.
|
||||||
event_sink.push_window_event(WindowEvent::Focused(false), window_id);
|
event_sink.push_window_event(WindowEvent::Focused(false), window_id);
|
||||||
|
|
||||||
// Reset the id.
|
|
||||||
inner.target_window_id = None;
|
|
||||||
}
|
}
|
||||||
KeyboardEvent::Key {
|
KeyboardEvent::Key {
|
||||||
rawkey,
|
rawkey,
|
||||||
|
|||||||
@@ -45,9 +45,6 @@ pub(super) fn handle_pointer(
|
|||||||
pointer_data.latest_enter_serial.replace(serial);
|
pointer_data.latest_enter_serial.replace(serial);
|
||||||
|
|
||||||
let window_id = wayland::make_wid(&surface);
|
let window_id = wayland::make_wid(&surface);
|
||||||
if !winit_state.window_map.contains_key(&window_id) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let window_handle = match winit_state.window_map.get_mut(&window_id) {
|
let window_handle = match winit_state.window_map.get_mut(&window_id) {
|
||||||
Some(window_handle) => window_handle,
|
Some(window_handle) => window_handle,
|
||||||
None => return,
|
None => return,
|
||||||
|
|||||||
Reference in New Issue
Block a user