2017-12-02 00:00:09 +11:00
# Unreleased
2019-07-30 04:16:14 +10:00
2020-01-04 16:11:00 +11:00
- On X11, fix `ModifiersChanged` emitting incorrect modifier change events
2020-01-04 10:17:05 +11:00
# 0.20.0 Alpha 6 (2020-01-03)
2020-01-03 11:34:14 +11:00
- On macOS, fix `set_cursor_visible` hides cursor outside of window.
2019-12-31 07:32:37 +11:00
- On macOS, fix `CursorEntered` and `CursorLeft` events fired at old window size.
2019-12-25 05:56:56 +11:00
- On macOS, fix error when `set_fullscreen` is called during fullscreen transition.
2019-12-22 17:04:11 +11:00
- On all platforms except mobile and WASM, implement `Window::set_minimized` .
2019-12-22 11:47:29 +11:00
- On X11, fix `CursorEntered` event being generated for non-winit windows.
2019-12-20 12:03:41 +11:00
- On macOS, fix crash when starting maximized without decorations.
2019-12-19 20:10:47 +11:00
- On macOS, fix application not to terminate on `run_return` .
2019-12-19 00:41:44 +11:00
- On Wayland, fix cursor icon updates on window borders when using CSD.
2019-12-20 11:08:28 +11:00
- On Wayland, under mutter(GNOME Wayland), fix CSD being behind the status bar, when starting window in maximized mode.
2019-12-23 06:04:09 +11:00
- On Windows, theme the title bar according to whether the system theme is "Light" or "Dark".
- Added `WindowEvent::ThemeChanged` variant to handle changes to the system theme. Currently only implemented on Windows.
2019-12-29 08:22:51 +11:00
- **Breaking**: Changes to the `RedrawRequested` event (#1041):
2019-12-23 03:23:27 +11:00
- `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.
2019-12-28 08:28:06 +11:00
- Implement synthetic window focus key events on Windows.
2019-12-29 07:36:06 +11:00
- **Breaking**: Change `ModifiersState` to a `bitflags` struct.
2019-12-31 06:11:11 +11:00
- On Windows, implement `VirtualKeyCode` translation for `LWin` and `RWin` .
- On Windows, fix closing the last opened window causing `DeviceEvent` s to stop getting emitted.
2019-12-30 02:39:15 +11:00
- On Windows, fix `Window::set_visible` not setting internal flags correctly. This resulted in some weird behavior.
2019-12-31 06:11:11 +11:00
- Add `DeviceEvent::ModifiersChanged` .
- Deprecate `modifiers` fields in other events in favor of `ModifiersChanged` .
2020-01-04 10:15:47 +11:00
- On X11, `WINIT_HIDPI_FACTOR` now dominates `Xft.dpi` when picking DPI factor for output.
- On X11, add special value `randr` for `WINIT_HIDPI_FACTOR` to make winit use self computed DPI factor instead of the one from `Xft.dpi` .
2019-12-19 00:41:44 +11:00
2019-12-23 03:24:49 +11:00
# 0.20.0 Alpha 5 (2019-12-09)
2019-12-10 11:29:50 +11:00
2019-10-24 01:24:50 +11:00
- On macOS, fix application termination on `ControlFlow::Exit`
2019-11-30 07:49:43 +11:00
- On Windows, fix missing `ReceivedCharacter` events when Alt is held.
2019-11-27 20:14:36 +11:00
- On macOS, stop emitting private corporate characters in `ReceivedCharacter` events.
2019-11-11 07:55:29 +11:00
- On X11, fix misreporting DPI factor at startup.
2019-11-11 05:24:43 +11:00
- On X11, fix events not being reported when using `run_return` .
2019-11-10 18:16:44 +11:00
- On X11, fix key modifiers being incorrectly reported.
2019-11-23 11:11:04 +11:00
- On X11, fix window creation hanging when another window is fullscreen.
2019-11-27 14:49:15 +11:00
- On Windows, fix focusing unfocused windows when switching from fullscreen to windowed.
2019-12-05 04:18:20 +11:00
- On X11, fix reporting incorrect DPI factor when waking from suspend.
2019-12-08 04:22:03 +11:00
- Change `EventLoopClosed` to contain the original event.
2019-12-29 08:22:51 +11:00
- **Breaking**: Add `is_synthetic` field to `WindowEvent` variant `KeyboardInput` ,
2019-12-08 09:51:37 +11:00
indicating that the event is generated by winit.
- On X11, generate synthetic key events for keys held when a window gains or loses focus.
2019-12-12 11:23:55 +11:00
- On X11, issue a `CursorMoved` event when a `Touch` event occurs,
as X11 implicitly moves the cursor for such events.
2019-10-24 01:24:50 +11:00
2019-10-19 04:25:12 +11:00
# 0.20.0 Alpha 4 (2019-10-18)
2019-09-28 06:57:25 +10:00
- Add web support via the 'stdweb' or 'web-sys' features
2019-10-06 05:52:40 +11:00
- On Windows, implemented function to get HINSTANCE
2019-08-23 19:30:53 +10:00
- On macOS, implement `run_return` .
2019-08-27 09:56:10 +10:00
- On iOS, fix inverted parameter in `set_prefers_home_indicator_hidden` .
2019-08-27 12:06:59 +10:00
- On X11, performance is improved when rapidly calling `Window::set_cursor_icon` .
2019-08-28 09:20:24 +10:00
- On iOS, fix improper `msg_send` usage that was UB and/or would break if `!` is stabilized.
- On Windows, unset `maximized` when manually changing the window's position or size.
2019-09-10 04:15:49 +10:00
- On Windows, add touch pressure information for touch events.
2019-09-13 09:38:44 +10:00
- On macOS, differentiate between `CursorIcon::Grab` and `CursorIcon::Grabbing` .
2019-09-12 08:22:41 +10:00
- On Wayland, fix event processing sometimes stalling when using OpenGL with vsync.
2019-09-16 12:09:08 +10:00
- Officially remove the Emscripten backend.
- On Windows, fix handling of surrogate pairs when dispatching `ReceivedCharacter` .
2019-09-16 09:59:37 +10:00
- On macOS 10.15, fix freeze upon exiting exclusive fullscreen mode.
2019-10-17 09:52:10 +11:00
- On iOS, fix panic upon closing the app.
2019-09-24 00:10:33 +10:00
- On X11, allow setting mulitple `XWindowType` s.
2019-09-17 04:27:46 +10:00
- On iOS, fix null window on initial `HiDpiFactorChanged` event.
2019-09-20 01:48:20 +10:00
- On Windows, fix fullscreen window shrinking upon getting restored to a normal window.
2019-09-18 12:49:29 +10:00
- On macOS, fix events not being emitted during modal loops, such as when windows are being resized
by the user.
2019-09-18 01:34:48 +10:00
- On Windows, fix hovering the mouse over the active window creating an endless stream of CursorMoved events.
2019-10-18 01:59:07 +11:00
- Always dispatch a `RedrawRequested` event after creating a new window.
2019-09-24 04:45:29 +10:00
- On X11, return dummy monitor data to avoid panicking when no monitors exist.
2019-09-20 01:47:51 +10:00
- On X11, prevent stealing input focus when creating a new window.
Only steal input focus when entering fullscreen mode.
2019-12-22 17:04:11 +11:00
- On Wayland, fixed DeviceEvents for relative mouse movement is not always produced
2019-10-02 11:25:59 +10:00
- On Wayland, add support for set_cursor_visible and set_cursor_grab.
2019-10-04 06:19:10 +10:00
- On Wayland, fixed DeviceEvents for relative mouse movement is not always produced.
- Removed `derivative` crate dependency.
2019-10-03 23:02:59 +10:00
- On Wayland, add support for set_cursor_icon.
2019-10-06 00:49:24 +10:00
- Use `impl Iterator<Item = MonitorHandle>` instead of `AvailableMonitorsIter` consistently.
2019-10-06 07:23:06 +11:00
- On macOS, fix fullscreen state being updated after entering fullscreen instead of before,
resulting in `Window::fullscreen` returning the old state in `Resized` events instead of
reflecting the new fullscreen state
2019-10-06 06:00:54 +11:00
- On X11, fix use-after-free during window creation
2019-10-06 07:23:30 +11:00
- On Windows, disable monitor change keyboard shortcut while in exclusive fullscreen.
- On Windows, ensure that changing a borderless fullscreen window's monitor via keyboard shortcuts keeps the window fullscreen on the new monitor.
2019-10-19 02:51:06 +11:00
- Prevent `EventLoop::new` and `EventLoop::with_user_event` from getting called outside the main thread.
- This is because some platforms cannot run the event loop outside the main thread. Preventing this
reduces the potential for cross-platform compatibility gotchyas.
- On Windows and Linux X11/Wayland, add platform-specific functions for creating an `EventLoop` outside the main thread.
2019-11-01 11:45:45 +11:00
- On Wayland, drop resize events identical to the current window size.
2019-10-17 02:59:06 +11:00
- On Windows, fix window rectangle not getting set correctly on high-DPI systems.
2019-08-23 19:30:53 +10:00
2019-08-15 01:09:47 +10:00
# 0.20.0 Alpha 3 (2019-08-14)
2019-07-24 06:44:07 +10:00
- On macOS, drop the run closure on exit.
2019-07-23 11:26:52 +10:00
- On Windows, location of `WindowEvent::Touch` are window client coordinates instead of screen coordinates.
- On X11, fix delayed events after window redraw.
2019-07-29 18:07:36 +10:00
- On macOS, add `WindowBuilderExt::with_disallow_hidpi` to have the option to turn off best resolution openGL surface.
2019-07-29 19:18:23 +10:00
- On Windows, screen saver won't start if the window is in fullscreen mode.
2019-07-30 00:58:16 +10:00
- Change all occurrences of the `new_user_event` method to `with_user_event` .
2019-07-30 04:16:14 +10:00
- On macOS, the dock and the menu bar are now hidden in fullscreen mode.
- `Window::set_fullscreen` now takes `Option<Fullscreen>` where `Fullscreen`
consists of `Fullscreen::Exclusive(VideoMode)` and
`Fullscreen::Borderless(MonitorHandle)` variants.
- Adds support for exclusive fullscreen mode.
2019-07-31 16:57:31 +10:00
- On iOS, add support for hiding the home indicator.
- On iOS, add support for deferring system gestures.
- On iOS, fix a crash that occurred while acquiring a monitor's name.
2019-08-01 17:30:05 +10:00
- On iOS, fix armv7-apple-ios compile target.
2019-08-06 06:51:42 +10:00
- Removed the `T: Clone` requirement from the `Clone` impl of `EventLoopProxy<T>` .
2019-08-07 06:47:00 +10:00
- On iOS, disable overscan compensation for external displays (removes black
bars surrounding the image).
2019-08-09 07:50:22 +10:00
- On Linux, the functions `is_wayland` , `is_x11` , `xlib_xconnection` and `wayland_display` have been moved to a new `EventLoopWindowTargetExtUnix` trait.
2019-08-09 09:10:54 +10:00
- On iOS, add `set_prefers_status_bar_hidden` extension function instead of
hijacking `set_decorations` for this purpose.
2019-08-09 10:13:14 +10:00
- On macOS and iOS, corrected the auto trait impls of `EventLoopProxy` .
2019-08-14 08:12:13 +10:00
- On iOS, add touch pressure information for touch events.
2019-08-14 21:57:16 +10:00
- Implement `raw_window_handle::HasRawWindowHandle` for `Window` type on all supported platforms.
2019-08-14 14:01:22 +10:00
- On macOS, fix the signature of `-[NSView drawRect:]` .
2019-09-05 07:23:11 +10:00
- On iOS, fix the behavior of `ControlFlow::Poll` . It wasn't polling if that was the only mode ever used by the application.
- On iOS, fix DPI sent out by views on creation was `0.0` - now it gives a reasonable number.
- On iOS, RedrawRequested now works for gl/metal backed views.
- On iOS, RedrawRequested is generally ordered after EventsCleared.
2019-08-09 10:13:14 +10:00
2019-07-10 09:19:00 +10:00
# 0.20.0 Alpha 2 (2019-07-09)
2019-07-10 08:25:32 +10:00
2019-07-04 20:43:44 +10:00
- On X11, non-resizable windows now have maximize explicitly disabled.
2019-06-29 08:07:36 +10:00
- On Windows, support paths longer than MAX_PATH (260 characters) in `WindowEvent::DroppedFile`
and `WindowEvent::HoveredFile` .
2019-06-27 16:58:21 +10:00
- On Mac, implement `DeviceEvent::Button` .
2019-06-22 12:59:31 +10:00
- Change `Event::Suspended(true / false)` to `Event::Suspended` and `Event::Resumed` .
2019-06-23 16:39:26 +10:00
- 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.
2019-06-29 05:31:54 +10:00
- Revert the use of invisible surfaces in Wayland, which introduced graphical glitches with OpenGL (#835)
2019-06-28 10:40:27 +10:00
- On X11, implement `_NET_WM_PING` to allow desktop environment to kill unresponsive programs.
2019-06-26 14:04:49 +10:00
- On Windows, when a window is initially invisible, it won't take focus from the existing visible windows.
2019-07-05 06:14:15 +10:00
- On Windows, fix multiple calls to `request_redraw` during `EventsCleared` sending multiple `RedrawRequested 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 before `EventsCleared` .
2019-07-04 04:19:07 +10:00
- On macOS, drop unused Metal dependency.
2019-07-07 03:29:15 +10:00
- On Windows, fix the trail effect happening on transparent decorated windows. Borderless (or un-decorated) windows were not affected.
2019-07-06 07:28:11 +10:00
- On Windows, fix `with_maximized` not properly setting window size to entire window.
2019-07-08 06:14:00 +10:00
- On macOS, change `WindowExtMacOS::request_user_attention()` to take an `enum` instead of a `bool` .
2019-06-22 12:59:31 +10:00
2019-07-10 08:25:32 +10:00
# 0.20.0 Alpha 1 (2019-06-21)
2019-06-22 01:33:44 +10:00
2019-02-06 02:30:33 +11:00
- Changes below are considered **breaking** .
- Change all occurrences of `EventsLoop` to `EventLoop` .
- Previously flat API is now exposed through `event` , `event_loop` , `monitor` , and `window` modules.
- `os` module changes:
- Renamed to `platform` .
- All traits now have platform-specific suffixes.
- Exposes new `desktop` module on Windows, Mac, and Linux.
- Changes to event loop types:
- `EventLoopProxy::wakeup` has been removed in favor of `send_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.
- `ControlFlow` 's variants have been replaced with `Wait` , `WaitUntil(Instant)` , `Poll` , and `Exit` .
- 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.
- Takes a closure that implements `'static + FnMut(Event<T>, &EventLoop<T>, &mut ControlFlow)` .
- `&EventLoop<T>` is provided to allow new `Window` s to be created.
- **Major:** `platform::desktop` module exposes `EventLoopExtDesktop` trait with `run_return` method.
- Behaves identically to `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` .
- Changes to events:
- Remove `Event::Awakened` in favor of `Event::UserEvent(T)` .
- Can be sent with `EventLoopProxy::send_event` .
- Rename `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` .
- **Major:** Add `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.
- 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 the `run` or `run_return` method is about to exit.
- Rename `MonitorId` to `MonitorHandle` .
- Removed `serde` implementations from `ControlFlow` .
2019-05-30 11:29:54 +10:00
- 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.
2019-06-11 09:09:38 +10:00
- **Breaking:** On macOS, change `ns` identifiers to use snake_case for consistency with iOS's `ui` identifiers.
2019-06-13 04:07:25 +10:00
- Add `MonitorHandle::video_modes` method for retrieving supported video modes for the given monitor.
2019-06-14 02:50:02 +10:00
- On Wayland, the window now exists even if nothing has been drawn.
2019-06-14 05:17:56 +10:00
- On Windows, fix initial dimensions of a fullscreen window.
2019-06-21 13:59:27 +10:00
- On Windows, Fix transparent borderless windows rendering wrong.
2019-04-08 15:08:31 +10:00
# Version 0.19.1 (2019-04-08)
2019-04-08 15:07:47 +10:00
- On Wayland, added a `get_wayland_display` function to `EventsLoopExt` .
2019-03-20 13:19:41 +11:00
- On Windows, fix `CursorMoved(0, 0)` getting dispatched on window focus.
2019-03-26 05:05:07 +11:00
- On macOS, fix command key event left and right reverse.
2019-03-23 01:44:00 +11:00
- On FreeBSD, NetBSD, and OpenBSD, fix build of X11 backend.
2019-06-23 03:57:56 +10:00
- On Linux, the numpad's add, subtract and divide keys are now mapped to the `Add` , `Subtract` and `Divide` virtual key codes
- On macOS, the numpad's subtract key has been added to the `Subtract` mapping
- On Wayland, the numpad's home, end, page up and page down keys are now mapped to the `Home` , `End` , `PageUp` and `PageDown` virtual key codes
2019-04-08 15:07:12 +10:00
- On Windows, fix icon not showing up in corner of window.
2019-04-08 02:48:21 +10:00
- 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.
2019-03-20 13:19:41 +11:00
2019-03-07 13:50:13 +11:00
# Version 0.19.0 (2019-03-06)
2019-03-06 12:58:14 +11:00
- On X11, we will use the faster `XRRGetScreenResourcesCurrent` function instead of `XRRGetScreenResources` when available.
2019-02-24 07:41:55 +11:00
- On macOS, fix keycodes being incorrect when using a non-US keyboard layout.
2019-02-23 01:30:59 +11:00
- On Wayland, fix `with_title()` not setting the windows title
2019-01-29 21:04:15 +11:00
- On Wayland, add `set_wayland_theme()` to control client decoration color theme
2019-01-16 04:30:02 +11:00
- Added serde serialization to `os::unix::XWindowType` .
2019-02-24 12:59:00 +11:00
- **Breaking:** Remove the `icon_loading` feature and the associated `image` dependency.
2019-02-25 10:02:55 +11:00
- On X11, make event loop thread safe by replacing XNextEvent with select(2) and XCheckIfEvent
2019-02-05 03:52:00 +11:00
- On Windows, fix malformed function pointer typecast that could invoke undefined behavior.
- Refactored Windows state/flag-setting code.
- On Windows, hiding the cursor no longer hides the cursor for all Winit windows - just the one `hide_cursor` was called on.
- On Windows, cursor grabs used to get perpetually canceled when the grabbing window lost focus. Now, cursor grabs automatically get re-initialized when the window regains focus and the mouse moves over the client area.
2019-02-23 01:31:16 +11:00
- On Windows, only vertical mouse wheel events were handled. Now, horizontal mouse wheel events are also handled.
2019-03-06 09:55:01 +11:00
- On Windows, ignore the AltGr key when populating the `ModifersState` type.
2019-01-16 04:30:02 +11:00
2019-01-10 01:16:41 +11:00
# Version 0.18.1 (2018-12-30)
2018-12-20 05:32:14 +11:00
- On macOS, fix `Yen` (JIS) so applications receive the event.
2018-12-19 14:20:31 +11:00
- On X11 with a tiling WM, fixed high CPU usage when moving windows across monitors.
2018-11-11 05:54:50 +11:00
- On X11, fixed panic caused by dropping the window before running the event loop.
2018-12-19 15:07:33 +11:00
- on macOS, added `WindowExt::set_simple_fullscreen` which does not require a separate space
2018-11-16 08:59:56 +11:00
- Introduce `WindowBuilderExt::with_app_id` to allow setting the application ID on Wayland.
2018-11-18 06:20:04 +11:00
- On Windows, catch panics in event loop child thread and forward them to the parent thread. This prevents an invocation of undefined behavior due to unwinding into foreign code.
2018-11-17 14:17:32 +11:00
- On Windows, fix issue where resizing or moving window combined with grabbing the cursor would freeze program.
- On Windows, fix issue where resizing or moving window would eat `Awakened` events.
2018-11-21 07:57:06 +11:00
- On Windows, exiting fullscreen after entering fullscreen with disabled decorations no longer shrinks window.
2018-11-18 07:51:39 +11:00
- On X11, fixed a segfault when using virtual monitors with XRandR.
2018-11-20 08:59:04 +11:00
- Derive `Ord` and `PartialOrd` for `VirtualKeyCode` enum.
2018-11-20 19:28:26 +11:00
- On Windows, fix issue where hovering or dropping a non file item would create a panic.
2018-11-21 07:21:58 +11:00
- On Wayland, fix resizing and DPI calculation when a `wl_output` is removed without sending a `leave` event to the `wl_surface` , such as disconnecting a monitor from a laptop.
2018-12-11 06:55:40 +11:00
- On Wayland, DPI calculation is handled by smithay-client-toolkit.
2018-12-01 08:19:50 +11:00
- On X11, `WindowBuilder::with_min_dimensions` and `WindowBuilder::with_max_dimensions` now correctly account for DPI.
2018-12-22 03:51:48 +11:00
- Added support for generating dummy `DeviceId` s and `WindowId` s to better support unit testing.
2018-12-28 06:22:00 +11:00
- On macOS, fixed unsoundness in drag-and-drop that could result in drops being rejected.
2018-12-28 07:16:58 +11:00
- On macOS, implemented `WindowEvent::Refresh` .
2018-12-29 07:29:29 +11:00
- On macOS, all `MouseCursor` variants are now implemented and the cursor will no longer reset after unfocusing.
2018-12-30 13:02:02 +11:00
- Removed minimum supported Rust version guarantee.
2018-11-11 05:54:50 +11:00
2018-11-07 16:43:15 +11:00
# Version 0.18.0 (2018-11-07)
2018-10-24 11:29:11 +11:00
- **Breaking:** `image` crate upgraded to 0.20. This is exposed as part of the `icon_loading` API.
2018-10-18 13:34:02 +11:00
- On Wayland, pointer events will now provide the current modifiers state.
2018-10-18 13:03:26 +11:00
- On Wayland, titles will now be displayed in the window header decoration.
- On Wayland, key repetition is now ended when keyboard loses focus.
2018-10-15 10:15:43 +11:00
- On Wayland, windows will now use more stylish and modern client side decorations.
2018-09-21 03:48:36 +10:00
- On Wayland, windows will use server-side decorations when available.
2018-11-07 16:43:15 +11:00
- **Breaking:** Added support for F16-F24 keys (variants were added to the `VirtualKeyCode` enum).
2018-08-25 03:48:57 +10:00
- 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.
2018-09-12 05:03:42 +10:00
- Updated window manager hints under X11 to v1.5 of [Extended Window Manager Hints ](https://specifications.freedesktop.org/wm-spec/wm-spec-1.5.html#idm140200472629520 ).
2018-09-21 07:00:04 +10:00
- Added `WindowBuilderExt::with_gtk_theme_variant` to X11-specific `WindowBuilder` functions.
2018-09-21 07:59:37 +10:00
- Fixed UTF8 handling bug in X11 `set_title` function.
2018-09-23 11:03:38 +10:00
- On Windows, `Window::set_cursor` now applies immediately instead of requiring specific events to occur first.
2018-10-25 05:40:12 +11:00
- On Windows, the `HoveredFile` and `HoveredFileCancelled` events are now implemented.
2018-10-18 13:03:26 +11:00
- On Windows, fix `Window::set_maximized` .
2018-10-18 14:20:12 +11:00
- On Windows 10, fix transparency (#260).
2018-10-20 07:32:57 +11:00
- On macOS, fix modifiers during key repeat.
2018-10-18 14:20:12 +11:00
- Implemented the `Debug` trait for `Window` , `EventsLoop` , `EventsLoopProxy` and `WindowBuilder` .
2018-10-20 07:32:57 +11:00
- 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.
2018-10-22 09:12:51 +11:00
- On Linux, if neither X11 nor Wayland manage to initialize, the corresponding panic now consists of a single line only.
2018-11-01 19:24:56 +11:00
- Add optional `serde` feature with implementations of `Serialize` /`Deserialize` for DPI types and various event types.
- Add `PartialEq` , `Eq` , and `Hash` implementations on public types that could have them but were missing them.
2018-11-03 08:41:51 +11:00
- On X11, drag-and-drop receiving an unsupported drop type can no longer cause the WM to freeze.
2018-11-06 06:34:54 +11:00
- Fix issue whereby the OpenGL context would not appear at startup on macOS Mojave (#1069).
2018-11-06 10:54:22 +11:00
- **Breaking:** Removed `From<NSApplicationActivationPolicy>` impl from `ActivationPolicy` on macOS.
2018-11-07 15:50:40 +11:00
- On macOS, the application can request the user's attention with `WindowExt::request_user_attention` .
2018-08-24 03:20:02 +10:00
2018-08-20 08:27:57 +10:00
# Version 0.17.2 (2018-08-19)
2018-08-16 09:42:57 +10:00
- On macOS, fix `<C-Tab>` so applications receive the event.
- On macOS, fix `<Cmd-{key}>` so applications receive the event.
2018-08-20 07:17:40 +10:00
- On Wayland, key press events will now be repeated.
2018-08-16 09:42:57 +10:00
2018-08-08 04:24:43 +10:00
# Version 0.17.1 (2018-08-05)
- 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.
2018-08-05 16:24:49 +10:00
2018-08-03 06:26:30 +10:00
# Version 0.17.0 (2018-08-02)
- Cocoa and core-graphics updates.
- Fixed thread-safety issues in several `Window` functions on Windows.
2018-07-26 03:36:33 +10:00
- On MacOS, the key state for modifiers key events is now properly set.
2018-07-14 05:10:12 +10:00
- 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.
2018-07-17 00:25:27 +10:00
- Added NetBSD support.
2018-07-26 04:49:46 +10:00
- **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 to `GLKView` (OpenGLES) or `MTKView` (Metal/MoltenVK).
- On iOS, the `UIApplication` is not started until `Window::new` is called.
2018-07-27 07:14:16 +10:00
- Fixed thread unsafety with cursor hiding on macOS.
2018-07-27 09:27:26 +10:00
- On iOS, fixed the size of the `JmpBuf` type used for `setjmp` /`longjmp` calls. Previously this was a buffer overflow on most architectures.
2018-08-03 03:03:15 +10:00
- On Windows, use cached window DPI instead of repeatedly querying the system. This fixes sporadic crashes on Windows 7.
2018-07-14 05:10:12 +10:00
2018-07-08 07:21:53 +10:00
# Version 0.16.2 (2018-07-07)
2018-07-04 10:15:19 +10:00
- On Windows, non-resizable windows now have the maximization button disabled. This is consistent with behavior on macOS and popular X11 WMs.
2018-07-06 01:52:25 +10:00
- Corrected incorrect `unreachable!` usage when guessing the DPI factor with no detected monitors.
2018-07-04 10:15:19 +10:00
2018-07-03 10:14:38 +10:00
# Version 0.16.1 (2018-07-02)
2018-07-02 01:01:46 +10:00
- 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.
2018-07-03 01:05:25 +10:00
- Fixed X11 backend compilation for environments where `c_char` is unsigned.
2018-07-02 01:01:46 +10:00
2018-06-26 06:47:10 +10:00
# Version 0.16.0 (2018-06-25)
2018-06-22 11:33:29 +10:00
- Windows additionally has `WindowBuilderExt::with_no_redirection_bitmap` .
2018-06-14 03:24:33 +10:00
- **Breaking:** Removed `VirtualKeyCode::LMenu` and `VirtualKeyCode::RMenu` ; Windows now generates `VirtualKeyCode::LAlt` and `VirtualKeyCode::RAlt` instead.
2018-06-15 09:42:18 +10:00
- On X11, exiting fullscreen no longer leaves the window in the monitor's top left corner.
- **Breaking:** `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.
- The Windows backend is now DPI aware. `WindowEvent::HiDpiFactorChanged` is implemented, and `MonitorId::get_hidpi_factor` and `Window::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 both `MonitorId::get_hidpi_factor` and `Window::get_hidpi_factor` return accurate values.
- On Emscripten, `MonitorId::get_hidpi_factor` now returns the same value as `Window::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` 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.
- **Breaking:** All deprecated methods have been removed. For `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.
- HiDPI support for Wayland.
2018-06-17 00:14:12 +10:00
- `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` .
2018-06-18 05:08:26 +10:00
- Fixed quirk on macOS where certain keys would generate characters at twice the normal rate when held down.
2018-06-18 10:44:38 +10:00
- On X11, all event loops now share the same `XConnection` .
2018-06-19 02:32:18 +10:00
- **Breaking:** `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.
2018-06-20 00:30:15 +10:00
- **Breaking:** `Window::set_cursor_position` now returns `Result<(), String>` , thus allowing for `Box<Error>` conversion via `?` .
2018-06-14 03:24:33 +10:00
2018-06-14 02:06:22 +10:00
# Version 0.15.1 (2018-06-13)
2018-05-29 21:48:47 +10:00
- On X11, the `Moved` event is no longer sent when the window is resized without changing position.
- `MouseCursor` and `CursorState` now implement `Default` .
2018-06-14 01:18:44 +10:00
- `WindowBuilder::with_resizable` implemented for Windows, X11, Wayland, and macOS.
- `Window::set_resizable` implemented for Windows, X11, Wayland, and macOS.
2018-06-04 03:11:54 +10:00
- On X11, if the monitor's width or height in millimeters is reported as 0, the DPI is now 1.0 instead of +inf.
2018-06-04 02:41:47 +10:00
- On X11, the environment variable `WINIT_HIDPI_FACTOR` has been added for overriding DPI factor.
2018-06-04 03:11:54 +10:00
- On X11, enabling transparency no longer causes the window contents to flicker when resizing.
- On X11, `with_override_redirect` now actually enables override redirect.
2018-06-07 01:30:26 +10:00
- macOS now generates `VirtualKeyCode::LAlt` and `VirtualKeyCode::RAlt` instead of `None` for both.
- On macOS, `VirtualKeyCode::RWin` and `VirtualKeyCode::LWin` are no longer switched.
2018-06-08 03:29:23 +10:00
- On macOS, windows without decorations can once again be resized.
2018-06-08 04:08:19 +10:00
- Fixed race conditions when creating an `EventsLoop` on X11, most commonly manifesting as "[xcb] Unknown sequence number while processing queue".
2018-06-12 01:16:39 +10:00
- On macOS, `CursorMoved` and `MouseInput` events are only generated if they occurs within the window's client area.
- On macOS, resizing the window no longer generates a spurious `MouseInput` event.
2018-05-29 21:48:47 +10:00
2018-05-23 04:17:41 +10:00
# Version 0.15.0 (2018-05-22)
2018-05-11 08:42:41 +10:00
- `Icon::to_cardinals` is no longer public, since it was never supposed to be.
2018-05-12 21:58:11 +10:00
- Wayland: improve diagnostics if initialization fails
2018-05-13 12:10:57 +10:00
- Fix some system event key doesn't work when focused, do not block keyevent forward to system on macOS
2018-05-13 22:44:23 +10:00
- On X11, the scroll wheel position is now correctly reset on i3 and other WMs that have the same quirk.
2018-05-14 22:14:57 +10:00
- On X11, `Window::get_current_monitor` now reliably returns the correct monitor.
- On X11, `Window::hidpi_factor` returns values from XRandR rather than the inaccurate values previously queried from the core protocol.
- On X11, the primary monitor is detected correctly even when using versions of XRandR less than 1.5.
- `MonitorId` now implements `Debug` .
2018-05-16 22:51:56 +10:00
- Fixed bug on macOS where using `with_decorations(false)` would cause `set_decorations(true)` to produce a transparent titlebar with no title.
2018-05-16 23:41:45 +10:00
- Implemented `MonitorId::get_position` on macOS.
- On macOS, `Window::get_current_monitor` now returns accurate values.
2018-05-17 00:16:36 +10:00
- Added `WindowBuilderExt::with_resize_increments` to macOS.
- **Breaking:** On X11, `WindowBuilderExt::with_resize_increments` and `WindowBuilderExt::with_base_size` now take `u32` values rather than `i32` .
2018-05-18 11:28:30 +10:00
- macOS keyboard handling has been overhauled, allowing for the use of dead keys, IME, etc. Right modifier keys are also no longer reported as being left.
- Added the `Window::set_ime_spot(x: i32, y: i32)` method, which is implemented on X11 and macOS.
- **Breaking**: `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.
2018-05-19 08:48:19 +10:00
- Fixed detection of `Pause` and `Scroll` keys on Windows.
2018-05-23 04:17:41 +10:00
- On Windows, alt-tabbing while the cursor is grabbed no longer makes it impossible to re-grab the cursor.
2018-05-20 02:02:57 +10:00
- On Windows, using `CursorState::Hide` when the cursor is grabbed now ungrabs the cursor first.
- Implemented `MouseCursor::NoneCursor` on Windows.
2018-05-21 00:24:05 +10:00
- Added `WindowBuilder::with_always_on_top` and `Window::set_always_on_top` . Implemented on Windows, macOS, and X11.
2018-05-21 00:47:22 +10:00
- On 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` .
- More hints are set by default on X11, including `_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` .
2018-05-11 08:42:41 +10:00
2018-05-10 00:58:06 +10:00
# Version 0.14.0 (2018-05-09)
2018-05-03 09:18:52 +10:00
- Created the `Copy` , `Paste` and `Cut` `VirtualKeyCode` s and added support for them on X11 and Wayland
2018-04-30 08:51:57 +10:00
- Fix `.with_decorations(false)` in macOS
2018-04-29 02:10:06 +10:00
- On Mac, `NSWindow` 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.
2018-04-28 14:12:50 +10:00
- Fix regression of Window platform extensions for macOS where `NSFullSizeContentViewWindowMask` was not being correctly applied to `.fullsize_content_view` .
Windows: Position fixes (#479)
* Remove executable flag from os/macos.rs
This was causing me some grief while working on Windows, and it
doesn't belong here to begin with.
* Windows: get_position returns screen coordinates instead of workspace coordinates
Previously, get_position used GetWindowPlacement. As per the
documentation of WINDOWSTRUCT, the returned coordinates are in
workspace space, meaning they're relative to the taskbar. It's
also explicitly remarked that these coordinates should only be
used in conjunction with SetWindowPlacement, as mixing them with
functions expecting screen coordinates can cause unpleasantness.
Since our set_position (correctly) uses SetWindowPos, this meant
that passing the return of get_position to set_position would
cause the window to move.
We now use GetWindowRect, which returns screen coordinates. This
gives us both better consistency within the Windows backend and
across platforms.
Note that this only makes a difference if the taskbar is visible.
With the taskbar hidden, the values are exactly the same as before.
* Windows: Moved event position values are consistent with get_position
The old Moved values had two problems:
* They were obtained by casting a WORD (u16) straight to an i32.
This meant wrap-around would never be interpreted as negative,
thus negative positions (which are ubiquitous when using multiple
monitors) would result in positions around u16::MAX.
* WM_MOVE supplies client area positions, not window positions.
Switching to handling WM_WINDOWPOSCHANGED solves both of these
problems.
* Better documentation for Moved and Resized
2018-04-27 10:09:33 +10:00
- Corrected `get_position` on Windows to be relative to the screen rather than to the taskbar.
- Corrected `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` ).
2018-04-28 10:46:20 +10:00
- Implemented `Moved` event on macOS.
X11: General cleanup (#491)
* X11: General cleanup
This is almost entirely internal changes, and as usual, doesn't actually
fix any problems people have complained about.
- `XSetInputFocus` can't be called before the window is visible. This
was previously handled by looping (with a sleep) and querying for the
window's state until it was visible. Now we use `XIfEvent`, which blocks
until we receive `VisibilityNotify`. Note that this can't be replaced
with an `XSync` (I tried).
- We now call `XSync` at the end of window creation and check for
errors, assuring that broken windows are never returned. When creating
invisible windows, this is the only time the output buffer is flushed
during the entire window creation process (AFAIK). For visible windows,
`XIfEvent` will generally flush, but window creation has overall been
reduced to the minimum number of flushes.
- `check_errors().expect()` has been a common pattern throughout the
backend, but it seems that people (myself included) didn't make a
distinction between using it after synchronous requests and asynchronous
requests. Now we only use it after async requests if we flush first,
though this still isn't correct (since the request likely hasn't been
processed yet). The only real solution (besides forcing a sync *every
time*) is to handle asynchronous errors *asynchronously*. For future
work, I plan on adding logging, though I don't plan on actually
*handling* those errors; that's more of something to hope for in the
hypothetical async/await XCB paradise.
- We now flush whenever it makes sense to. `util::Flusher` was added to
force contributors to be aware of the output buffer.
- `Window::get_position`, `Window::get_inner_position`,
`Window::get_inner_size`, and `Window::get_outer_size` previously all
required *several* round-trips. On my machine, it took an average of
around 80µs. They've now been reduced to one round-trip each, which
reduces my measurement to 16µs. This was accomplished simply by caching
the frame extents, which are expensive to calculate (due to various
queries and heuristics), but change infrequently and predictably. I
still recommend that application developers use these methods sparingly
and generally prefer storing the values from `Resized`/`Moved`, as
that's zero overhead.
- The above change enabled me to change the `Moved` event to supply
window positions, rather than client area positions. Additionally, we no
longer generate `Moved` for real (as in, not synthetic)
`ConfigureNotify` events. Real `ConfigureNotify` events contain
positions relative to the parent window, which are typically constant
and useless. Since that position would be completely different from the
root-relative positions supplied by synthetic `ConfigureNotify` events
(which are the vast majority of them), that meant real `ConfigureNotify`
events would *always* be detected as the position having changed, so the
resultant `Moved` was multiple levels of misleading. In practice, this
meant a garbage `Moved` would be sent every time the window was resized;
now a resize has to actually change the window's position to be
accompanied by `Moved`.
- Every time we processed an `XI_Enter` event, we would leak 4 bytes via
`util::query_pointer` (`XIQueryPointer`). `XIButtonState` contains a
dynamically-allocated mask field which we weren't freeing. As this event
occurs with fairly high frequency, long-running applications could
easily accumulate substantial leaks. `util::PointerState::drop` now
takes care of this.
- The `util` module has been split up into several sub-modules, as it
was getting rather lengthy. This accounts for a significant part of this
diff, unfortunately.
- Atoms are now cached. Xlib caches them too, so `XInternAtom` wouldn't
typically be a round-trip anyway, but the added complexity is
negligible.
- Switched from `std::sync::Mutex` to `parking_lot::Mutex` (within this
backend). There appears to be no downside to this, but if anyone finds
one, this would be easy to revert.
- The WM name and supported hints are now global to the application, and
are updated upon `ReparentNotify`, which should detect when the WM was
replaced (assuming a reparenting WM was involved, that is). Previously,
these values were per-window and would never update, meaning replacing
the WM could potentially lead to (admittedly very minor) problems.
- The result of `Window2::create_empty_cursor` will now only be used if
it actually succeeds.
- `Window2::load_cursor` no longer re-allocates the cursor name.
- `util::lookup_utf8` previously allocated a 16-byte buffer on the heap.
Now it allocates a 1024-byte buffer on the stack, and falls back to
dynamic allocation if the buffer is too small. This base buffer size is
admittedly gratuitous, but less so if you're using IME.
- `with_c_str` was finally removed.
- Added `util::Format` enum to help prevent goofs when dealing with
format arguments.
- `util::get_property`, something I added way back in my first winit PR,
only calculated offsets correctly for `util::Format::Char`. This was
concealed by the accomodating buffer size, as it would be very rare for
the offset to be needed; however, testing with a buffer size of 1,
`util::Format::Long` would read from the same offset multiple times, and
`util::Format::Short` would miss data. This function now works correctly
for all formats, relying on the simple fact that the offset increases by
the buffer size on each iteration. We also account for the extra byte
that `XGetWindowProperty` allocates at the end of the buffer, and copy
data from the buffer instead of moving it and taking ownership of the
pointer.
- Drag and drop now reliably works in release mode. This is presumably
related to the `util::get_property` changes.
- `util::change_property` now exists, which should make it easier to add
features in the future.
- The `EventsLoop` device map is no longer in a mutex.
- `XConnection` now implements `Debug`.
- Valgrind no longer complains about anything related to winit (with
either the system allocator or jemalloc, though "not having valgrind
complain about jemalloc" isn't something to strive for).
* X11: Add better diagnostics when initialization fails
* X11: Handle XIQueryDevice failure
* X11: Use correct types in error handler
2018-05-03 23:15:49 +10:00
- On X11, the `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.
Windows: Implement DeviceEvents (#482)
Fixes #467
All variants other than Text have been implemented. While Text can
be implemented using ToUnicode, that doesn't play nice with dead
keys, IME, etc.
Most of the mouse DeviceEvents were already implemented, but due
to the flags that were used when registering for raw input events,
they only worked when the window was in the foreground.
This is also a step forward for #338, as DeviceIds are no longer
useless on Windows. On DeviceEvents, the DeviceId contains that
device's handle. While that handle could ostensibly be used by
developers to query device information, my actual reason for
choosing it is because it's simply a very easy way to handle this.
As a fun bonus, this enabled me to create this method:
DevideIdExt::get_persistent_identifier() -> Option<String>
Using this gives you a unique identifier for the device that
persists across replugs/reboots/etc., so it's ideal for something
like device-specific configuration.
There's a notable caveat to the new DeviceIds, which is that the
value will always be 0 for a WindowEvent. There doesn't seem to be
any straightforward way around this limitation.
I was concerned that multi-window applications would receive n
copies of every DeviceEvent, but Windows only sends them to one
window per application.
Lastly, there's a chance that these additions will cause
antivirus/etc. software to detect winit applications as keyloggers.
I don't know how likely that is to actually happen to people, but
if it does become an issue, the raw input code is neatly
sequestered and would be easy to make optional during compilation.
2018-04-29 02:42:33 +10:00
- On Windows, implemented all variants of `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.
2018-04-29 09:03:06 +10:00
- Corrected `run_forever` on X11 to stop discarding `Awakened` events.
X11: General cleanup (#491)
* X11: General cleanup
This is almost entirely internal changes, and as usual, doesn't actually
fix any problems people have complained about.
- `XSetInputFocus` can't be called before the window is visible. This
was previously handled by looping (with a sleep) and querying for the
window's state until it was visible. Now we use `XIfEvent`, which blocks
until we receive `VisibilityNotify`. Note that this can't be replaced
with an `XSync` (I tried).
- We now call `XSync` at the end of window creation and check for
errors, assuring that broken windows are never returned. When creating
invisible windows, this is the only time the output buffer is flushed
during the entire window creation process (AFAIK). For visible windows,
`XIfEvent` will generally flush, but window creation has overall been
reduced to the minimum number of flushes.
- `check_errors().expect()` has been a common pattern throughout the
backend, but it seems that people (myself included) didn't make a
distinction between using it after synchronous requests and asynchronous
requests. Now we only use it after async requests if we flush first,
though this still isn't correct (since the request likely hasn't been
processed yet). The only real solution (besides forcing a sync *every
time*) is to handle asynchronous errors *asynchronously*. For future
work, I plan on adding logging, though I don't plan on actually
*handling* those errors; that's more of something to hope for in the
hypothetical async/await XCB paradise.
- We now flush whenever it makes sense to. `util::Flusher` was added to
force contributors to be aware of the output buffer.
- `Window::get_position`, `Window::get_inner_position`,
`Window::get_inner_size`, and `Window::get_outer_size` previously all
required *several* round-trips. On my machine, it took an average of
around 80µs. They've now been reduced to one round-trip each, which
reduces my measurement to 16µs. This was accomplished simply by caching
the frame extents, which are expensive to calculate (due to various
queries and heuristics), but change infrequently and predictably. I
still recommend that application developers use these methods sparingly
and generally prefer storing the values from `Resized`/`Moved`, as
that's zero overhead.
- The above change enabled me to change the `Moved` event to supply
window positions, rather than client area positions. Additionally, we no
longer generate `Moved` for real (as in, not synthetic)
`ConfigureNotify` events. Real `ConfigureNotify` events contain
positions relative to the parent window, which are typically constant
and useless. Since that position would be completely different from the
root-relative positions supplied by synthetic `ConfigureNotify` events
(which are the vast majority of them), that meant real `ConfigureNotify`
events would *always* be detected as the position having changed, so the
resultant `Moved` was multiple levels of misleading. In practice, this
meant a garbage `Moved` would be sent every time the window was resized;
now a resize has to actually change the window's position to be
accompanied by `Moved`.
- Every time we processed an `XI_Enter` event, we would leak 4 bytes via
`util::query_pointer` (`XIQueryPointer`). `XIButtonState` contains a
dynamically-allocated mask field which we weren't freeing. As this event
occurs with fairly high frequency, long-running applications could
easily accumulate substantial leaks. `util::PointerState::drop` now
takes care of this.
- The `util` module has been split up into several sub-modules, as it
was getting rather lengthy. This accounts for a significant part of this
diff, unfortunately.
- Atoms are now cached. Xlib caches them too, so `XInternAtom` wouldn't
typically be a round-trip anyway, but the added complexity is
negligible.
- Switched from `std::sync::Mutex` to `parking_lot::Mutex` (within this
backend). There appears to be no downside to this, but if anyone finds
one, this would be easy to revert.
- The WM name and supported hints are now global to the application, and
are updated upon `ReparentNotify`, which should detect when the WM was
replaced (assuming a reparenting WM was involved, that is). Previously,
these values were per-window and would never update, meaning replacing
the WM could potentially lead to (admittedly very minor) problems.
- The result of `Window2::create_empty_cursor` will now only be used if
it actually succeeds.
- `Window2::load_cursor` no longer re-allocates the cursor name.
- `util::lookup_utf8` previously allocated a 16-byte buffer on the heap.
Now it allocates a 1024-byte buffer on the stack, and falls back to
dynamic allocation if the buffer is too small. This base buffer size is
admittedly gratuitous, but less so if you're using IME.
- `with_c_str` was finally removed.
- Added `util::Format` enum to help prevent goofs when dealing with
format arguments.
- `util::get_property`, something I added way back in my first winit PR,
only calculated offsets correctly for `util::Format::Char`. This was
concealed by the accomodating buffer size, as it would be very rare for
the offset to be needed; however, testing with a buffer size of 1,
`util::Format::Long` would read from the same offset multiple times, and
`util::Format::Short` would miss data. This function now works correctly
for all formats, relying on the simple fact that the offset increases by
the buffer size on each iteration. We also account for the extra byte
that `XGetWindowProperty` allocates at the end of the buffer, and copy
data from the buffer instead of moving it and taking ownership of the
pointer.
- Drag and drop now reliably works in release mode. This is presumably
related to the `util::get_property` changes.
- `util::change_property` now exists, which should make it easier to add
features in the future.
- The `EventsLoop` device map is no longer in a mutex.
- `XConnection` now implements `Debug`.
- Valgrind no longer complains about anything related to winit (with
either the system allocator or jemalloc, though "not having valgrind
complain about jemalloc" isn't something to strive for).
* X11: Add better diagnostics when initialization fails
* X11: Handle XIQueryDevice failure
* X11: Use correct types in error handler
2018-05-03 23:15:49 +10:00
- Various safety and correctness improvements to the X11 backend internals.
- Fixed memory leak on X11 every time the mouse entered the window.
- On X11, drag and drop now works reliably in release mode.
2018-05-03 23:41:11 +10:00
- Added `WindowBuilderExt::with_resize_increments` and `WindowBuilderExt::with_base_size` to X11, allowing for more optional hints to be set.
2018-05-06 03:36:34 +10:00
- Rework of the wayland backend, migrating it to use [Smithay's Client Toolkit ](https://github.com/Smithay/client-toolkit ).
2018-05-08 07:36:21 +10:00
- Added `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.
- Windows additionally has `WindowBuilderExt::with_taskbar_icon` and `WindowExt::set_taskbar_icon` .
2018-05-08 22:16:49 +10:00
- On Windows, fix panic when trying to call `set_fullscreen(None)` on a window that has not been fullscreened prior.
Windows: Position fixes (#479)
* Remove executable flag from os/macos.rs
This was causing me some grief while working on Windows, and it
doesn't belong here to begin with.
* Windows: get_position returns screen coordinates instead of workspace coordinates
Previously, get_position used GetWindowPlacement. As per the
documentation of WINDOWSTRUCT, the returned coordinates are in
workspace space, meaning they're relative to the taskbar. It's
also explicitly remarked that these coordinates should only be
used in conjunction with SetWindowPlacement, as mixing them with
functions expecting screen coordinates can cause unpleasantness.
Since our set_position (correctly) uses SetWindowPos, this meant
that passing the return of get_position to set_position would
cause the window to move.
We now use GetWindowRect, which returns screen coordinates. This
gives us both better consistency within the Windows backend and
across platforms.
Note that this only makes a difference if the taskbar is visible.
With the taskbar hidden, the values are exactly the same as before.
* Windows: Moved event position values are consistent with get_position
The old Moved values had two problems:
* They were obtained by casting a WORD (u16) straight to an i32.
This meant wrap-around would never be interpreted as negative,
thus negative positions (which are ubiquitous when using multiple
monitors) would result in positions around u16::MAX.
* WM_MOVE supplies client area positions, not window positions.
Switching to handling WM_WINDOWPOSCHANGED solves both of these
problems.
* Better documentation for Moved and Resized
2018-04-27 10:09:33 +10:00
2018-04-27 08:53:16 +10:00
# Version 0.13.1 (2018-04-26)
- Ensure necessary `x11-dl` version is used.
2018-04-26 01:43:32 +10:00
# Version 0.13.0 (2018-04-25)
2018-04-18 04:07:54 +10:00
- Implement `WindowBuilder::with_maximized` , `Window::set_fullscreen` , `Window::set_maximized` and `Window::set_decorations` for MacOS.
2018-04-13 03:12:15 +10:00
- Implement `WindowBuilder::with_maximized` , `Window::set_fullscreen` , `Window::set_maximized` and `Window::set_decorations` for Windows.
2018-04-26 01:43:32 +10:00
- On Windows, `WindowBuilder::with_fullscreen` no longer changing monitor display resolution.
2018-04-08 05:36:10 +10:00
- Overhauled X11 window geometry calculations. `get_position` and `set_position` are more universally accurate across different window managers, and `get_outer_size` actually works now.
2018-04-10 05:58:47 +10:00
- Fixed SIGSEGV/SIGILL crashes on macOS caused by stabilization of the `!` (never) type.
2018-04-11 11:42:22 +10:00
- Implement `WindowEvent::HiDPIFactorChanged` for macOS
2018-04-11 12:18:30 +10:00
- On X11, input methods now work completely out of the box, no longer requiring application developers to manually call `setlocale` . Additionally, when input methods are started, stopped, or restarted on the server end, it's correctly handled.
2018-04-11 23:29:01 +10:00
- Implemented `Refresh` event on Windows.
2018-04-14 04:15:30 +10:00
- Properly calculate the minimum and maximum window size on Windows, including window decorations.
2018-04-14 03:53:01 +10:00
- Map more `MouseCursor` variants to cursor icons on Windows.
2018-04-17 11:40:30 +10:00
- Corrected `get_position` on macOS to return outer frame position, not content area position.
- Corrected `set_position` on macOS to set outer frame position, not content area position.
- Added `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).
2018-04-25 06:20:40 +10:00
- **Breaking:** the `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` .
2018-04-08 05:36:10 +10:00
2018-04-06 19:19:12 +10:00
# Version 0.12.0 (2018-04-06)
2018-04-03 09:12:38 +10:00
- Added subclass to macos windows so they can be made resizable even with no decorations.
2018-04-06 02:58:24 +10:00
- Dead keys now work properly on X11, no longer resulting in a panic.
2018-04-06 03:21:50 +10:00
- On X11, input method creation first tries to use the value from the user's `XMODIFIERS` environment variable, so application developers should no longer need to manually call `XSetLocaleModifiers` . If that fails, fallbacks are tried, which should prevent input method initialization from ever outright failing.
2018-04-06 04:58:10 +10:00
- Fixed thread safety issues with input methods on X11.
2018-04-06 05:25:37 +10:00
- Add support for `Touch` for win32 backend.
2018-04-06 05:51:15 +10:00
- Fixed `Window::get_inner_size` and friends to return the size in pixels instead of points when using HIDPI displays on OSX.
2018-04-03 09:12:38 +10:00
2018-03-28 22:32:46 +11:00
# Version 0.11.3 (2018-03-28)
- Added `set_min_dimensions` and `set_max_dimensions` methods to `Window` , and implemented on Windows, X11, Wayland, and OSX.
x11: Destroy dropped windows; handle WM_DELETE_WINDOW (#416)
Fixes #79 #414
This changes the implementation of Drop for Window to send a WM_DELETE_WINDOW ClientMessage,
offloading all the cleanup and window destruction to the event loop. Unsurprisingly, this
entails that the event loop now handles WM_DELETE_WINDOW using the behavior that was
previously contained in Window's Drop implementation, along with destroying the Window.
Not only does this mean that dropped windows are closed, but also that clicking the × button
on the window actually closes it now.
The previous implemention of Drop was also broken, as the event loop would be (seemingly
permenanently) frozen after its invocation. That was caused specifically by the mutex
locking, and is no longer an issue now that the locking is done in the event loop.
While I don't have full confidence that it makes sense for the Drop implementation to behave
this way, this is nonetheless a significant improvement. The previous behavior led to
inconsistent state, panics, and event loop breakage, along with not actually destroying the
window.
This additionally makes the assumption that users don't need Focused or CursorLeft events
for the destroyed window, as Closed is adequate to indicate unfocus, and users may not
expect to receive events for closed/dropped windows. In my testing, those specific events
were sent immediately after the window was destroyed, though this sort of behavior could be
WM-specific. I've opted to explicitly suppress those events in the case of the window no
longer existing.
2018-03-23 20:31:31 +11:00
- On X11, dropping a `Window` actually closes it now, and clicking the window's × button (or otherwise having the WM signal to close it) will result in the window closing.
2018-03-23 20:25:02 +11:00
- Added `WindowBuilderExt` methods for macos: `with_titlebar_transparent` ,
`with_title_hidden` , `with_titlebar_buttons_hidden` ,
`with_fullsize_content_view` .
2018-03-23 20:36:04 +11:00
- Mapped X11 numpad keycodes (arrows, Home, End, PageUp, PageDown, Insert and Delete) to corresponding virtual keycodes
2018-03-07 04:07:18 +11:00
# Version 0.11.2 (2018-03-06)
2018-02-23 04:15:56 +11:00
- Impl `Hash` , `PartialEq` , and `Eq` for `events::ModifiersState` .
2018-03-06 19:35:04 +11:00
- Implement `MonitorId::get_hidpi_factor` for MacOS.
- Added method `os::macos::MonitorIdExt::get_nsscreen() -> *mut c_void` that gets a `NSScreen` object matching the monitor ID.
2018-03-07 04:06:56 +11:00
- Send `Awakened` event on Android when event loop is woken up.
2018-02-23 04:15:56 +11:00
2018-02-21 02:18:17 +11:00
# Version 0.11.1 (2018-02-19)
2018-02-14 20:31:25 +11:00
- Fixed windows not receiving mouse events when click-dragging the mouse outside the client area of a window, on Windows platforms.
2018-02-21 02:18:17 +11:00
- Added method `os::android::EventsLoopExt:set_suspend_callback(Option<Box<Fn(bool) -> ()>>)` that allows glutin to register a callback when a suspend event happens
2018-02-14 20:31:25 +11:00
2018-02-09 22:07:19 +11:00
# Version 0.11.0 (2018-02-09)
2018-02-06 04:50:13 +11:00
2018-02-09 22:07:19 +11:00
- Implement `MonitorId::get_dimensions` for Android.
2018-01-23 05:07:51 +11:00
- Added method `os::macos::WindowBuilderExt::with_movable_by_window_background(bool)` that allows to move a window without a titlebar - `with_decorations(false)`
2018-01-13 16:38:12 +11:00
- Implement `Window::set_fullscreen` , `Window::set_maximized` and `Window::set_decorations` for Wayland.
2018-01-25 23:32:30 +11:00
- Added `Caret` as VirtualKeyCode and support OSX ^-Key with german input.
2018-01-13 16:38:12 +11:00
2018-02-09 22:07:19 +11:00
# Version 0.10.1 (2018-02-05)
*Yanked*
2017-12-28 05:44:53 +11:00
# Version 0.10.0 (2017-12-27)
2017-12-02 00:00:09 +11:00
- Add support for `Touch` for emscripten backend.
2017-12-13 22:22:03 +11:00
- Added support for `DroppedFile` , `HoveredFile` , and `HoveredFileCancelled` to X11 backend.
2017-12-17 20:17:26 +11:00
- **Breaking:** `unix::WindowExt` no longer returns pointers for things that aren't actually pointers; `get_xlib_window` now returns `Option<std::os::raw::c_ulong>` and `get_xlib_screen_id` returns `Option<std::os::raw::c_int>` . Additionally, methods that previously returned `libc::c_void` have been changed to return `std::os::raw::c_void` , which are not interchangeable types, so users wanting the former will need to explicitly cast.
2017-12-22 23:50:46 +11:00
- Added `set_decorations` method to `Window` to allow decorations to be toggled after the window is built. Presently only implemented on X11.
2017-12-28 05:44:53 +11:00
- Raised the minimum supported version of Rust to 1.20 on MacOS due to usage of associated constants in new versions of cocoa and core-graphics.
2017-12-27 08:46:28 +11:00
- Added `modifiers` field to `MouseInput` , `MouseWheel` , and `CursorMoved` events to track the modifiers state (`ModifiersState`).
2017-12-28 05:44:53 +11:00
- Fixed the emscripten backend to return the size of the canvas instead of the size of the window.
2017-12-02 00:00:09 +11:00
2017-12-01 20:58:48 +11:00
# Version 0.9.0 (2017-12-01)
2017-09-22 16:00:19 +10:00
2017-10-17 22:56:38 +11:00
- Added event `WindowEvent::HiDPIFactorChanged` .
- Added method `MonitorId::get_hidpi_factor` .
- Deprecated `get_inner_size_pixels` and `get_inner_size_points` methods of `Window` in favor of
`get_inner_size` .
2017-10-19 05:40:21 +11:00
- **Breaking:** `EventsLoop` is `!Send` and `!Sync` because of platform-dependant constraints,
but `Window` , `WindowId` , `DeviceId` and `MonitorId` guaranteed to be `Send` .
2017-10-20 04:08:05 +11:00
- `MonitorId::get_position` now returns `(i32, i32)` instead of `(u32, u32)` .
2017-10-20 18:46:42 +11:00
- Rewrite of the wayland backend to use wayland-client-0.11
- Support for dead keys on wayland for keyboard utf8 input
2017-10-26 02:12:39 +11:00
- Monitor enumeration on Windows is now implemented using `EnumDisplayMonitors` instead of
`EnumDisplayDevices` . This changes the value returned by `MonitorId::get_name()` .
- On Windows added `MonitorIdExt::hmonitor` method
2017-10-26 05:03:57 +11:00
- Impl `Clone` for `EventsLoopProxy`
2017-10-29 00:24:37 +11:00
- `EventsLoop::get_primary_monitor()` on X11 will fallback to any available monitor if no primary is found
2017-11-11 20:03:42 +11:00
- Support for touch event on wayland
2017-11-13 07:56:57 +11:00
- `WindowEvent` s `MouseMoved` , `MouseEntered` , and `MouseLeft` have been renamed to
`CursorMoved` , `CursorEntered` , and `CursorLeft` .
- New `DeviceEvent` s added, `MouseMotion` and `MouseWheel` .
2017-12-01 20:58:48 +11:00
- Send `CursorMoved` event after `CursorEntered` and `Focused` events.
- Add support for `ModifiersState` , `MouseMove` , `MouseInput` , `MouseMotion` for emscripten backend.
2017-10-17 22:56:38 +11:00
2017-10-12 18:39:41 +11:00
# Version 0.8.3 (2017-10-11)
2017-10-04 18:42:35 +11:00
- Fixed issue of calls to `set_inner_size` blocking on Windows.
2017-10-08 22:59:45 +11:00
- Mapped `ISO_Left_Tab` to `VirtualKeyCode::Tab` to make the key work with modifiers
2017-10-08 06:20:37 +11:00
- Fixed the X11 backed on 32bit targets
2017-10-04 18:42:35 +11:00
2017-09-29 03:04:26 +10:00
# Version 0.8.2 (2017-09-28)
2017-09-25 15:25:36 +10:00
- Uniformize keyboard scancode values accross Wayland and X11 (#297).
2017-09-28 00:31:46 +10:00
- Internal rework of the wayland event loop
- Added method `os::linux::WindowExt::is_ready`
2017-09-25 15:25:36 +10:00
2017-09-23 17:36:30 +10:00
# Version 0.8.1 (2017-09-22)
- Added various methods to `os::linux::EventsLoopExt` , plus some hidden items necessary to make
glutin work.
2017-09-22 16:00:19 +10:00
# Version 0.8.0 (2017-09-21)
- Added `Window::set_maximized` , `WindowAttributes::maximized` and `WindowBuilder::with_maximized` .
- Added `Window::set_fullscreen` .
2017-09-23 17:36:21 +10:00
- Changed `with_fullscreen` to take a `Option<MonitorId>` instead of a `MonitorId` .
2017-09-22 16:00:19 +10:00
- Removed `MonitorId::get_native_identifer()` in favor of platform-specific traits in the `os`
module.
- Changed `get_available_monitors()` and `get_primary_monitor()` to be methods of `EventsLoop`
instead of stand-alone methods.
- Changed `EventsLoop` to be tied to a specific X11 or Wayland connection.
- Added a `os::linux::EventsLoopExt` trait that makes it possible to configure the connection.
- Fixed the emscripten code, which now compiles.
- Changed the X11 fullscreen code to use `xrandr` instead of `xxf86vm` .
- Fixed the Wayland backend to produce `Refresh` event after window creation.
- Changed the `Suspended` event to be outside of `WindowEvent` .
- Fixed the X11 backend sometimes reporting the wrong virtual key (#273).