The `text` is retrieved as UTF-8 while `attributes` are based on UTF-16,
thus the offset was getting out of sync on some unicode payloads
like surrogate pairs.
Fixes#3967.
Only mark that the grab was applied when it actually got applied.
Previously there was an issue with grab being marked as applied without
a pointer over the window, when in reality it wasn't.
Fixes#4073.
Same as for `CustomCursor`. However, the API uses `dyn` stuff only
because of `Windows` backend at the time of writing, generally, platforms
should just have a separate method that deals with all of that, and e.g.
top-level winit only guarantees `Rgba`.
By removing `NamedKey::Space` and rename "super" key to "meta".
- `NamedKey::Space` is not in the spec, and doesn't make sense to
special-case. We use `Key::Character("")` instead..
I've added an extra check on the Windows backend, to ensure that the code
functionally works the same before and after. Whether that check is
desirable or not can be figured out later.
- "super" is inconsistent with the W3C spec, and while it's arguably not the
best name, it's worse that Winit is diverging and choosing a different name.
List of renamings:
- `KeyCode::SuperLeft` -> `KeyCode::MetaLeft`
- `KeyCode::SuperRight` -> `KeyCode::MetaRight`
- `KeyCode::Meta` -> `KeyCode::Super`
- `NamedKey::Meta` -> `NamedKey::Super`
- `NamedKey::Super` -> `NamedKey::Meta`
- `ModifiersState::SUPER` -> `ModifiersState::META` (deprecated)
- `ModifiersState::super_key` -> `ModifiersState::meta_key`
- `ModifiersKeys::LSUPER` -> `ModifiersKeys::LMETA`
- `ModifiersKeys::RSUPER` -> `ModifiersKeys::RMETA`
Using `Duration::Zero` with `Wait` polling mode was still blocking until
the event was actually delivered. Thus when `pump_events` API is used,
ensure that it's not happening.
Fixes#4130.
Calling the `Drop` impl of the user's `ApplicationHandler` is important on
iOS and Web, since they don't return from `EventLoop::run_app`.
And now that we reliably call `Drop`, the `ApplicationHandler::exited`
event/callback is unnecessary; using `Drop` composes much better (open files
etc. stored in the app state will be automatically flushed), and prevents
weirdness like attempting to create a new window while exiting.
* Prevent panic when calling set_simple_fullscreen(false) on macos
Calling `set_simple_fullscreen(false)` to restore the window after
a previous call to `set_simple_fullscreen(true)` panics with
`view must be installed in a window` in the call to `set_style_mask`
with the old style.
Moving the `set_style_mask` call after the frame has been resized
fixes the issue.
* Hide the doc and menubar on macos when using set_borderless_game
with set_simple_fullscreen
* Fix a pause in the event loop when clicking the title bar on windows
When clicking the title bar on Windows, to drag the window, there is
a noticible pause in continuous redraw requests. This was fixed
in #839 and then regressed in #1852. The cursor blinks in both
cases and is unrelated. The regression made the blink happen after
the pause instead of immediately.
* Update the event loop pause note on the WM_NCLBUTTONDOWN handler
The application example was also updated to optionally animate the fill color
in order to demonstrate continuous redraw without pauses in the event
loop.
Relying on just `as_any` was error prone and will become redundant in
the future, once upcasting will be stable, we also won't to impose a
restriction on to which concrete type we're casting, since casting
to a type that doesn't implement a base trait doesn't make much
sense.
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
Due to casts and use of platform specific crates in those modules
it's not really feasible to build docs for them.
After separating crates, thus should become way easier to navigate,
since backends information would be publicly available.
This also alters `VideoMode` to be a regular object and not reference
the `MonitorHandle`, since it's a static data.
Given that `VideoMode` set may change during runtime keeping the
reference as a some sort of validity may not be idea and propagating
errors when changing video mode could be more reliable.
For EventLoop, EventLoopBuilder, EventLoopProxy and by requiring it as
a supertrait of Window and ActiveEventLoop.
It is especially useful for user to be able to know that Window is Debug.
This is done to avoid order-dependent behavior that you'd otherwise
encounter where `EventLoop::new` had to be called at the beginning of
`fn main` to ensure that Winit's application was the one being
registered as the main application by calling `sharedApplication`.
Fixes https://github.com/rust-windowing/winit/issues/3772.
This should also make it (more) possible to use multiple versions of
Winit in the same application (though that's still untested).
Finally, it should allow the user to override `NSApplication` themselves
if they need to do that for some reason.
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
This also includes 0.30.8 sync, since it was forgotten.