Window handling library in pure Rust
APACHE-2.0 License
Published by Osspial over 4 years ago
ControlFlow
was set to Poll
.WindowBuilder::with_maximized
being ignored.Published by murarth over 4 years ago
ResumeTimeReached
being fired too early.ControlFlow::Poll
with requestAnimationFrame
EventLoopProxy
leaking memory for every instance.Published by Osspial over 4 years ago
set_simple_screen
to remember frame excluding title bar.close_button_icon_color
not applying.ThemeChanged
on change.Event::to_static
returning None
for user events.ModifiersChanged
variant from DeviceEvent
to WindowEvent
.IconExtWindows
trait which exposes creating an Icon
from an external file or embedded resourceBadIcon::OsError
variant for when OS icon functionality failsi32
instead of u32
for position type in WindowEvent::Moved
.Published by goddessfreya over 4 years ago
link.exe
failed: exit code: 1120" error on older versions of windows.hide_application
to EventLoopWindowTarget
via a new EventLoopWindowTargetExtMacOS
trait. hide_application
will hide the entire application by calling -[NSApplication hide: nil]
.CursorMoved
event reporting the cursor position using logical coordinates.run_return
does not return unless it receives a message.RedrawRequested
would only get emitted every other iteration of the event loop.WindowBuilder
now implements Default
.WindowEvent::CursorMoved
changed to f64
units, preserving high-precision data supplied by most backendsWaylandTheme
struct has been replaced with a Theme
trait, allowing for extra configurationPublished by goddessfreya over 4 years ago
PhysicalSize
instead of LogicalSize
.Size
or Position
types can now take either Logical
or Physical
types.hidpi_factor
has been renamed to scale_factor
.HiDpiFactorChanged
has been renamed to ScaleFactorChanged
, and lets you control how the OSWINIT_HIDPI_FACTOR
environment variable in favor of WINIT_X11_SCALE_FACTOR
.Size
and Position
types are now generic over their exact pixel type.Published by goddessfreya over 4 years ago
set_cursor_visible
hides cursor outside of window.CursorEntered
and CursorLeft
events fired at old window size.set_fullscreen
is called during fullscreen transition.Window::set_minimized
.CursorEntered
event being generated for non-winit windows.run_return
.WindowEvent::ThemeChanged
variant to handle changes to the system theme. Currently only implemented on Windows.RedrawRequested
event (#1041):
RedrawRequested
has been moved from WindowEvent
to Event
.EventsCleared
has been renamed to MainEventsCleared
.RedrawRequested
is now issued only after MainEventsCleared
.RedrawEventsCleared
is issued after each set of RedrawRequested
events.ModifiersState
to a bitflags
struct.VirtualKeyCode
translation for LWin
and RWin
.DeviceEvent
s to stop getting emitted.Window::set_visible
not setting internal flags correctly. This resulted in some weird behavior.DeviceEvent::ModifiersChanged
.
modifiers
fields in other events in favor of ModifiersChanged
.WINIT_HIDPI_FACTOR
now dominates Xft.dpi
when picking DPI factor for output.randr
for WINIT_HIDPI_FACTOR
to make winit use self computed DPI factor instead of the one from Xft.dpi
.Published by goddessfreya over 4 years ago
ControlFlow::Exit
ReceivedCharacter
events when Alt is held.ReceivedCharacter
events.run_return
.EventLoopClosed
to contain the original event.is_synthetic
field to WindowEvent
variant KeyboardInput
,CursorMoved
event when a Touch
event occurs,Published by goddessfreya over 4 years ago
run_return
.set_prefers_home_indicator_hidden
.Window::set_cursor_icon
.msg_send
usage that was UB and/or would break if !
is stabilized.maximized
when manually changing the window's position or size.CursorIcon::Grab
and CursorIcon::Grabbing
.ReceivedCharacter
.XWindowType
s.HiDpiFactorChanged
event.RedrawRequested
event after creating a new window.derivative
crate dependency.impl Iterator<Item = MonitorHandle>
instead of AvailableMonitorsIter
consistently.Window::fullscreen
returning the old state in Resized
events instead ofEventLoop::new
and EventLoop::with_user_event
from getting called outside the main thread.
EventLoop
outside the main thread.Published by goddessfreya over 4 years ago
WindowEvent::Touch
are window client coordinates instead of screen coordinates.WindowBuilderExt::with_disallow_hidpi
to have the option to turn off best resolution openGL surface.new_user_event
method to with_user_event
.Window::set_fullscreen
now takes Option<Fullscreen>
where Fullscreen
Fullscreen::Exclusive(VideoMode)
andFullscreen::Borderless(MonitorHandle)
variants.
T: Clone
requirement from the Clone
impl of EventLoopProxy<T>
.is_wayland
, is_x11
, xlib_xconnection
and wayland_display
have been moved to a new EventLoopWindowTargetExtUnix
trait.set_prefers_status_bar_hidden
extension function instead ofset_decorations
for this purpose.EventLoopProxy
.raw_window_handle::HasRawWindowHandle
for Window
type on all supported platforms.-[NSView drawRect:]
.ControlFlow::Poll
. It wasn't polling if that was the only mode ever used by the application.0.0
- now it gives a reasonable number.Published by goddessfreya over 4 years ago
WindowEvent::DroppedFile
WindowEvent::HoveredFile
.DeviceEvent::Button
.Event::Suspended(true / false)
to Event::Suspended
and Event::Resumed
._NET_WM_PING
to allow desktop environment to kill unresponsive programs.request_redraw
during EventsCleared
sending multiple RedrawRequested events.
RedrawRequested
could be dispatched before input events in event loop iteration.RedrawRequested
but before EventsCleared
.with_maximized
not properly setting window size to entire window.WindowExtMacOS::request_user_attention()
to take an enum
instead of a bool
.EventsLoop
to EventLoop
.event
, event_loop
, monitor
, and window
modules.os
module changes:
platform
.desktop
module on Windows, Mac, and Linux.EventLoopProxy::wakeup
has been removed in favor of send_event
.run
method drives winit event loop.
!
to ensure API behaves identically across all supported platforms.
emscripten
implementation to work without lying about the API.ControlFlow
's variants have been replaced with Wait
, WaitUntil(Instant)
, Poll
, and Exit
.
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.'static + FnMut(Event<T>, &EventLoop<T>, &mut ControlFlow)
.
&EventLoop<T>
is provided to allow new Window
s to be created.platform::desktop
module exposes EventLoopExtDesktop
trait with run_return
method.
run
, but returns control flow to the calling context and can take non-'static
closures.EventLoop
's poll_events
and run_forever
methods have been removed in favor of run
and run_return
.Event::Awakened
in favor of Event::UserEvent(T)
.
EventLoopProxy::send_event
.WindowEvent::Refresh
to WindowEvent::RedrawRequested
.
RedrawRequested
can be sent by the user with the Window::request_redraw
method.EventLoop
, EventLoopProxy
, and Event
are now generic over T
, for use in UserEvent
.NewEvents(StartCause)
, EventsCleared
, and LoopDestroyed
variants to Event
.
NewEvents
is emitted when new events are ready to be processed by event loop.
StartCause
describes why new events are available, with ResumeTimeReached
, Poll
, WaitCancelled
, and Init
(sent once at start of loop).EventsCleared
is emitted when all available events have been processed.
LoopDestroyed
is emitted when the run
or run_return
method is about to exit.MonitorId
to MonitorHandle
.serde
implementations from ControlFlow
.WindowBuilder::multitouch
field, since it was only implemented on a few platforms. Multitouch is always enabled now.ns
identifiers to use snake_case for consistency with iOS's ui
identifiers.MonitorHandle::video_modes
method for retrieving supported video modes for the given monitor.Published by goddessfreya over 5 years ago
get_wayland_display
function to EventsLoopExt
.CursorMoved(0, 0)
getting dispatched on window focus.Published by francesca64 almost 6 years ago
image
crate upgraded to 0.20. This is exposed as part of the icon_loading
API.VirtualKeyCode
enum).WindowBuilderExt::with_gtk_theme_variant
to X11-specific WindowBuilder
functions.set_title
function.Window::set_cursor
now applies immediately instead of requiring specific events to occur first.HoveredFile
and HoveredFileCancelled
events are now implemented.Window::set_maximized
.Debug
trait for Window
, EventsLoop
, EventsLoopProxy
and WindowBuilder
.Resized
event will always be generated after a DPI change to ensure the window's logical size is consistent with the new DPI.serde
feature with implementations of Serialize
/Deserialize
for DPI types and various event types.PartialEq
, Eq
, and Hash
implementations on public types that could have them but were missing them.From<NSApplicationActivationPolicy>
impl from ActivationPolicy
on macOS.WindowExt::request_user_attention
.Published by francesca64 about 6 years ago
<C-Tab>
so applications receive the event.<Cmd-{key}>
so applications receive the event.Published by francesca64 about 6 years ago
Published by francesca64 about 6 years ago
Window
functions on Windows.UIView
is now the default root view. WindowBuilderExt::with_root_view_class
can be used to set the root view objective-c class to GLKView
(OpenGLES) or MTKView
(Metal/MoltenVK).UIApplication
is not started until Window::new
is called.JmpBuf
type used for setjmp
/longjmp
calls. Previously this was a buffer overflow on most architectures.Published by francesca64 over 6 years ago
unreachable!
usage when guessing the DPI factor with no detected monitors.Published by francesca64 over 6 years ago
log
. Logging will become more extensive over time.c_char
is unsigned.Published by francesca64 over 6 years ago
WindowBuilderExt::with_no_redirection_bitmap
.VirtualKeyCode::LMenu
and VirtualKeyCode::RMenu
; Windows now generates VirtualKeyCode::LAlt
and VirtualKeyCode::RAlt
instead.Window::hidpi_factor
has been renamed to Window::get_hidpi_factor
for better consistency. WindowEvent::HiDPIFactorChanged
has been renamed to WindowEvent::HiDpiFactorChanged
. DPI factors are always represented as f64
instead of f32
now.WindowEvent::HiDpiFactorChanged
is implemented, and MonitorId::get_hidpi_factor
and Window::hidpi_factor
return accurate values.WindowEvent::HiDpiFactorChanged
on X11.Window::set_cursor_position
is now relative to the client area.MonitorId::get_dimensions
has been implemented and both MonitorId::get_hidpi_factor
and Window::get_hidpi_factor
return accurate values.MonitorId::get_hidpi_factor
now returns the same value as Window::get_hidpi_factor
(it previously would always return 1.0).LogicalPosition
and LogicalSize
, respectively. The notable exception is MonitorId
methods, which deal in PhysicalPosition
and PhysicalSize
. See the documentation for specifics and explanations of the types. Additionally, winit automatically conserves logical size when the DPI factor changes.Window::platform_display
and Window::platform_window
, switch to the appropriate platform-specific WindowExt
methods. For Window::get_inner_size_points
and Window::get_inner_size_pixels
, use the LogicalSize
returned by Window::get_inner_size
and convert as needed.EventsLoop::get_available_monitors
and EventsLoop::get_primary_monitor
now have identical counterparts on Window
, so this information can be acquired without an EventsLoop
borrow.AvailableMonitorsIter
now implements Debug
.XConnection
.Window::set_cursor_state
and CursorState
enum removed in favor of the more composable Window::grab_cursor
and Window::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.Window::set_cursor_position
now returns Result<(), String>
, thus allowing for Box<Error>
conversion via ?
.Published by francesca64 over 6 years ago
Moved
event is no longer sent when the window is resized without changing position.MouseCursor
and CursorState
now implement Default
.WindowBuilder::with_resizable
implemented for Windows, X11, Wayland, and macOS.Window::set_resizable
implemented for Windows, X11, Wayland, and macOS.WINIT_HIDPI_FACTOR
has been added for overriding DPI factor.with_override_redirect
now actually enables override redirect.VirtualKeyCode::LAlt
and VirtualKeyCode::RAlt
instead of None
for both.VirtualKeyCode::RWin
and VirtualKeyCode::LWin
are no longer switched.EventsLoop
on X11, most commonly manifesting as "[xcb] Unknown sequence number while processing queue".CursorMoved
and MouseInput
events are only generated if they occurs within the window's client area.MouseInput
event.