Window handling library in pure Rust
APACHE-2.0 License
Published by francesca64 over 6 years ago
Icon::to_cardinals
is no longer public, since it was never supposed to be.Window::get_current_monitor
now reliably returns the correct monitor.Window::hidpi_factor
returns values from XRandR rather than the inaccurate values previously queried from the core protocol.MonitorId
now implements Debug
.with_decorations(false)
would cause set_decorations(true)
to produce a transparent titlebar with no title.MonitorId::get_position
on macOS.Window::get_current_monitor
now returns accurate values.WindowBuilderExt::with_resize_increments
to macOS.WindowBuilderExt::with_resize_increments
and WindowBuilderExt::with_base_size
now take u32
values rather than i32
.Window::set_ime_spot(x: i32, y: i32)
method, which is implemented on X11 and macOS.os::unix::WindowExt::send_xim_spot(x: i16, y: i16)
no longer exists. Switch to the new Window::set_ime_spot(x: i32, y: i32)
, which has equivalent functionality.Pause
and Scroll
keys on Windows.CursorState::Hide
when the cursor is grabbed now ungrabs the cursor first.MouseCursor::NoneCursor
on Windows.WindowBuilder::with_always_on_top
and Window::set_always_on_top
. Implemented on Windows, macOS, and X11.WindowBuilderExt
now has with_class
, with_override_redirect
, and with_x11_window_type
to allow for more control over window creation. WindowExt
additionally has set_urgent
._NET_WM_PID
and WM_CLIENT_MACHINE
. Note that prior to this, the WM_CLASS
hint was automatically set to whatever value was passed to with_title
. It's now set to the executable name to better conform to expectations and the specification; if this is undesirable, you must explicitly use WindowBuilderExt::with_class
.Published by francesca64 over 6 years ago
Copy
, Paste
and Cut
VirtualKeyCode
s and added support for them on X11 and Wayland.with_decorations(false)
in macOSNSWindow
and supporting objects might be alive long after they were closed
which resulted in apps consuming more heap then needed. Mainly it was affecting multi window applications. Not expecting any user visible change of behaviour after the fix.NSFullSizeContentViewWindowMask
was not being correctly applied to .fullsize_content_view
.get_position
on Windows to be relative to the screen rather than to the taskbar.Moved
event on Windows to use position values equivalent to those returned by get_position
. It previously supplied client area positions instead of window positions, and would additionally interpret negative values as being very large (around u16::MAX
).Moved
event on macOS.Moved
event correctly use window positions rather than client area positions. Additionally, a stray Moved
that unconditionally accompanied Resized
with the client area position relative to the parent has been eliminated; Moved
is still received alongside Resized
, but now only once and always correctly.DeviceEvent
other than Text
. Mouse DeviceEvent
s are now received even if the window isn't in the foreground.DeviceId
on Windows is no longer a unit struct, and now contains a u32
. For WindowEvent
s, this will always be 0, but on DeviceEvent
s it will be the handle to that device. DeviceIdExt::get_persistent_identifier
can be used to acquire a unique identifier for that device that persists across replugs/reboots/etc.run_forever
on X11 to stop discarding Awakened
events.WindowBuilderExt::with_resize_increments
and WindowBuilderExt::with_base_size
to X11, allowing for more optional hints to be set.WindowBuilder::with_window_icon
and Window::set_window_icon
, finally making it possible to set the window icon on Windows and X11. The icon_loading
feature can be enabled to allow for icons to be easily loaded; see example program window_icon.rs
for usage.WindowBuilderExt::with_taskbar_icon
and WindowExt::set_taskbar_icon
.set_fullscreen(None)
on a window that has not been fullscreened prior.Published by francesca64 over 6 years ago
WindowBuilder::with_maximized
, Window::set_fullscreen
, Window::set_maximized
and Window::set_decorations
for MacOS.WindowBuilder::with_maximized
, Window::set_fullscreen
, Window::set_maximized
and Window::set_decorations
for Windows.WindowBuilder::with_fullscreen
no longer changing monitor display resolution.get_position
and set_position
are more universally accurate across different window managers, and get_outer_size
actually works now.!
(never) type.WindowEvent::HiDPIFactorChanged
for macOSsetlocale
. Additionally, when input methods are started, stopped, or restarted on the server end, it's correctly handled.Refresh
event on Windows.MouseCursor
variants to cursor icons on Windows.get_position
on macOS to return outer frame position, not content area position.set_position
on macOS to set outer frame position, not content area position.get_inner_position
method to Window
, which gets the position of the window's client area. This is implemented on all applicable platforms (all desktop platforms other than Wayland, where this isn't possible).Closed
event has been replaced by CloseRequested
and Destroyed
. To migrate, you typically just need to replace all usages of Closed
with CloseRequested
; see example programs for more info. The exception is iOS, where Closed
must be replaced by Destroyed
.