Releases: rust-windowing/winit
Releases · rust-windowing/winit
v0.20.0-alpha2
- On X11, non-resizable windows now have maximize explicitly disabled.
- On Windows, support paths longer than MAX_PATH (260 characters) in
WindowEvent::DroppedFile
andWindowEvent::HoveredFile
. - On Mac, implement
DeviceEvent::Button
. - Change
Event::Suspended(true / false)
toEvent::Suspended
andEvent::Resumed
. - On X11, fix sanity check which checks that a monitor's reported width and height (in millimeters) are non-zero when calculating the DPI factor.
- Revert the use of invisible surfaces in Wayland, which introduced graphical glitches with OpenGL (#835)
- On X11, implement
_NET_WM_PING
to allow desktop environment to kill unresponsive programs. - On Windows, when a window is initially invisible, it won't take focus from the existing visible windows.
- On Windows, fix multiple calls to
request_redraw
duringEventsCleared
sending multipleRedrawRequested events.
- On Windows, fix edge case where
RedrawRequested
could be dispatched before input events in event loop iteration. - On Windows, fix timing issue that could cause events to be improperly dispatched after
RedrawRequested
but beforeEventsCleared
. - On macOS, drop unused Metal dependency.
- On Windows, fix the trail effect happening on transparent decorated windows. Borderless (or un-decorated) windows were not affected.
- On Windows, fix
with_maximized
not properly setting window size to entire window. - On macOS, change
WindowExtMacOS::request_user_attention()
to take anenum
instead of abool
.
v0.20.0-alpha1
- Changes below are considered breaking.
- Change all occurrences of
EventsLoop
toEventLoop
. - Previously flat API is now exposed through
event
,event_loop
,monitor
, andwindow
modules. os
module changes:- Renamed to
platform
. - All traits now have platform-specific suffixes.
- Exposes new
desktop
module on Windows, Mac, and Linux.
- Renamed to
- Changes to event loop types:
EventLoopProxy::wakeup
has been removed in favor ofsend_event
.- Major: New
run
method drives winit event loop.- Returns
!
to ensure API behaves identically across all supported platforms.- This allows
emscripten
implementation to work without lying about the API.
- This allows
ControlFlow
's variants have been replaced withWait
,WaitUntil(Instant)
,Poll
, andExit
.- Is read after
EventsCleared
is processed. Wait
waits until new events are available.WaitUntil
waits until either new events are available or the provided time has been reached.Poll
instantly resumes the event loop.Exit
aborts the event loop.
- Is read after
- Takes a closure that implements
'static + FnMut(Event<T>, &EventLoop<T>, &mut ControlFlow)
.&EventLoop<T>
is provided to allow newWindow
s to be created.
- Returns
- Major:
platform::desktop
module exposesEventLoopExtDesktop
trait withrun_return
method.- Behaves identically to
run
, but returns control flow to the calling context and can take non-'static
closures.
- Behaves identically to
EventLoop
'spoll_events
andrun_forever
methods have been removed in favor ofrun
andrun_return
.
- Changes to events:
- Remove
Event::Awakened
in favor ofEvent::UserEvent(T)
.- Can be sent with
EventLoopProxy::send_event
.
- Can be sent with
- Rename
WindowEvent::Refresh
toWindowEvent::RedrawRequested
.RedrawRequested
can be sent by the user with theWindow::request_redraw
method.
EventLoop
,EventLoopProxy
, andEvent
are now generic overT
, for use inUserEvent
.- Major: Add
NewEvents(StartCause)
,EventsCleared
, andLoopDestroyed
variants toEvent
.NewEvents
is emitted when new events are ready to be processed by event loop.StartCause
describes why new events are available, withResumeTimeReached
,Poll
,WaitCancelled
, andInit
(sent once at start of loop).
EventsCleared
is emitted when all available events have been processed.- Can be used to perform logic that depends on all events being processed (e.g. an iteration of a game loop).
LoopDestroyed
is emitted when therun
orrun_return
method is about to exit.
- Remove
- Rename
MonitorId
toMonitorHandle
. - Removed
serde
implementations fromControlFlow
. - Rename several functions to improve both internal consistency and compliance with Rust API guidelines.
- Remove
WindowBuilder::multitouch
field, since it was only implemented on a few platforms. Multitouch is always enabled now. - Breaking: On macOS, change
ns
identifiers to use snake_case for consistency with iOS'sui
identifiers. - Add
MonitorHandle::video_modes
method for retrieving supported video modes for the given monitor. - On Wayland, the window now exists even if nothing has been drawn.
- On Windows, fix initial dimensions of a fullscreen window.
- On Windows, Fix transparent borderless windows rendering wrong.
v0.19.1
- On Wayland, added a
get_wayland_display
function toEventsLoopExt
. - On Windows, fix
CursorMoved(0, 0)
getting dispatched on window focus. - On macOS, fix command key event left and right reverse.
- On FreeBSD, NetBSD, and OpenBSD, fix build of X11 backend.
- On Windows, fix icon not showing up in corner of window.
- On X11, change DPI scaling factor behavior. First, winit tries to read it from "Xft.dpi" XResource, and uses DPI calculation from xrandr dimensions as fallback behavior.
v0.18.0
- Breaking:
image
crate upgraded to 0.20. This is exposed as part of theicon_loading
API. - On Wayland, pointer events will now provide the current modifiers state.
- On Wayland, titles will now be displayed in the window header decoration.
- On Wayland, key repetition is now ended when keyboard loses focus.
- On Wayland, windows will now use more stylish and modern client side decorations.
- On Wayland, windows will use server-side decorations when available.
- Breaking: Added support for F16-F24 keys (variants were added to the
VirtualKeyCode
enum). - Fixed graphical glitches when resizing on Wayland.
- On Windows, fix freezes when performing certain actions after a window resize has been triggered. Reintroduces some visual artifacts when resizing.
- Updated window manager hints under X11 to v1.5 of Extended Window Manager Hints.
- Added
WindowBuilderExt::with_gtk_theme_variant
to X11-specificWindowBuilder
functions. - Fixed UTF8 handling bug in X11
set_title
function. - On Windows,
Window::set_cursor
now applies immediately instead of requiring specific events to occur first. - On Windows, the
HoveredFile
andHoveredFileCancelled
events are now implemented. - On Windows, fix
Window::set_maximized
. - On Windows 10, fix transparency (#260).
- On macOS, fix modifiers during key repeat.
- Implemented the
Debug
trait forWindow
,EventsLoop
,EventsLoopProxy
andWindowBuilder
. - On X11, now a
Resized
event will always be generated after a DPI change to ensure the window's logical size is consistent with the new DPI. - Added further clarifications to the DPI docs.
- On Linux, if neither X11 nor Wayland manage to initialize, the corresponding panic now consists of a single line only.
- Add optional
serde
feature with implementations ofSerialize
/Deserialize
for DPI types and various event types. - Add
PartialEq
,Eq
, andHash
implementations on public types that could have them but were missing them. - On X11, drag-and-drop receiving an unsupported drop type can no longer cause the WM to freeze.
- Fix issue whereby the OpenGL context would not appear at startup on macOS Mojave (#1069).
- Breaking: Removed
From<NSApplicationActivationPolicy>
impl fromActivationPolicy
on macOS. - On macOS, the application can request the user's attention with
WindowExt::request_user_attention
.
v0.17.2
- On macOS, fix
<C-Tab>
so applications receive the event. - On macOS, fix
<Cmd-{key}>
so applications receive the event. - On Wayland, key press events will now be repeated.
v0.17.1
- On X11, prevent a compilation failure in release mode for versions of Rust greater than or equal to 1.30.
- Fixed deadlock that broke fullscreen mode on Windows.
v0.17.0
- Cocoa and core-graphics updates.
- Fixed thread-safety issues in several
Window
functions on Windows. - On MacOS, the key state for modifiers key events is now properly set.
- On iOS, the view is now set correctly. This makes it possible to render things (instead of being stuck on a black screen), and touch events work again.
- Added NetBSD support.
- Breaking: On iOS,
UIView
is now the default root view.WindowBuilderExt::with_root_view_class
can be used to set the root view objective-c class toGLKView
(OpenGLES) orMTKView
(Metal/MoltenVK). - On iOS, the
UIApplication
is not started untilWindow::new
is called. - Fixed thread unsafety with cursor hiding on macOS.
- On iOS, fixed the size of the
JmpBuf
type used forsetjmp
/longjmp
calls. Previously this was a buffer overflow on most architectures. - On Windows, use cached window DPI instead of repeatedly querying the system. This fixes sporadic crashes on Windows 7.
v0.16.2
- On Windows, non-resizable windows now have the maximization button disabled. This is consistent with behavior on macOS and popular X11 WMs.
- Corrected incorrect
unreachable!
usage when guessing the DPI factor with no detected monitors.
v0.16.1
- Added logging through
log
. Logging will become more extensive over time. - On X11 and Windows, the window's DPI factor is guessed before creating the window. This greatly cuts back on unsightly auto-resizing that would occur immediately after window creation.
- Fixed X11 backend compilation for environments where
c_char
is unsigned.
v0.16.0
- Windows additionally has
WindowBuilderExt::with_no_redirection_bitmap
. - Breaking: Removed
VirtualKeyCode::LMenu
andVirtualKeyCode::RMenu
; Windows now generatesVirtualKeyCode::LAlt
andVirtualKeyCode::RAlt
instead. - On X11, exiting fullscreen no longer leaves the window in the monitor's top left corner.
- Breaking:
Window::hidpi_factor
has been renamed toWindow::get_hidpi_factor
for better consistency.WindowEvent::HiDPIFactorChanged
has been renamed toWindowEvent::HiDpiFactorChanged
. DPI factors are always represented asf64
instead off32
now. - The Windows backend is now DPI aware.
WindowEvent::HiDpiFactorChanged
is implemented, andMonitorId::get_hidpi_factor
andWindow::hidpi_factor
return accurate values. - Implemented
WindowEvent::HiDpiFactorChanged
on X11. - On macOS,
Window::set_cursor_position
is now relative to the client area. - On macOS, setting the maximum and minimum dimensions now applies to the client area dimensions rather than to the window dimensions.
- On iOS,
MonitorId::get_dimensions
has been implemented and bothMonitorId::get_hidpi_factor
andWindow::get_hidpi_factor
return accurate values. - On Emscripten,
MonitorId::get_hidpi_factor
now returns the same value asWindow::get_hidpi_factor
(it previously would always return 1.0). - Breaking: The entire API for sizes, positions, etc. has changed. In the majority of cases, winit produces and consumes positions and sizes as
LogicalPosition
andLogicalSize
, respectively. The notable exception isMonitorId
methods, which deal inPhysicalPosition
andPhysicalSize
. See the documentation for specifics and explanations of the types. Additionally, winit automatically conserves logical size when the DPI factor changes. - Breaking: All deprecated methods have been removed. For
Window::platform_display
andWindow::platform_window
, switch to the appropriate platform-specificWindowExt
methods. ForWindow::get_inner_size_points
andWindow::get_inner_size_pixels
, use theLogicalSize
returned byWindow::get_inner_size
and convert as needed. - HiDPI support for Wayland.
EventsLoop::get_available_monitors
andEventsLoop::get_primary_monitor
now have identical counterparts onWindow
, so this information can be acquired without anEventsLoop
borrow.AvailableMonitorsIter
now implementsDebug
.- Fixed quirk on macOS where certain keys would generate characters at twice the normal rate when held down.
- On X11, all event loops now share the same
XConnection
. - Breaking:
Window::set_cursor_state
andCursorState
enum removed in favor of the more composableWindow::grab_cursor
andWindow::hide_cursor
. As a result, grabbing the cursor no longer automatically hides it; you must call both methods to retain the old behavior on Windows and macOS.Cursor::NoneCursor
has been removed, as it's no longer useful. - Breaking:
Window::set_cursor_position
now returnsResult<(), String>
, thus allowing forBox<Error>
conversion via?
.