1# Unreleased
2
3- On iOS, fixed support for the "Debug View Heirarchy" feature in Xcode.
4- On all platforms, `available_monitors` and `primary_monitor` are now on `EventLoopWindowTarget` rather than `EventLoop` to list monitors event in the event loop.
5- On Unix, X11 and Wayland are now optional features (enabled by default)
6- On X11, fix deadlock when calling `set_fullscreen_inner`.
7- On Web, prevent the webpage from scrolling when the user is focused on a winit canvas
8- On Web, calling `window.set_cursor_icon` no longer breaks HiDPI scaling
9- On Windows, drag and drop is now optional and must be enabled with `WindowBuilderExtWindows::with_drag_and_drop(true)`.
10- On Wayland, fix deadlock when calling to `set_inner_size` from a callback.
11- On macOS, add `hide__other_applications` to `EventLoopWindowTarget` via existing `EventLoopWindowTargetExtMacOS` trait. `hide_other_applications` will hide other applications by calling `-[NSApplication hideOtherApplications: nil]`.
12- On android added support for `run_return`.
13- On MacOS, Fixed fullscreen and dialog support for `run_return`.
14- On Windows, fix bug where we'd try to emit `MainEventsCleared` events during nested win32 event loops.
15- On Web, use mouse events if pointer events aren't supported. This affects Safari.
16- On Windows, `set_ime_position` is now a no-op instead of a runtime crash.
17- On Android, `set_fullscreen` is now a no-op instead of a runtime crash.
18- On iOS and Android, `set_inner_size` is now a no-op instead of a runtime crash.
19- On Android, fix `ControlFlow::Poll` not polling the Android event queue.
20- On macOS, add `NSWindow.hasShadow` support.
21- **Breaking:** On Web, `set_cursor_position` and `set_cursor_grab` will now always return an error.
22- **Breaking:** `PixelDelta` scroll events now return a `PhysicalPosition`.
23
24# 0.22.2 (2020-05-16)
25
26- Added Clone implementation for 'static events.
27- On Windows, fix window intermittently hanging when `ControlFlow` was set to `Poll`.
28- On Windows, fix `WindowBuilder::with_maximized` being ignored.
29- On Android, minimal platform support.
30- On iOS, touch positions are now properly converted to physical pixels.
31- On macOS, updated core-* dependencies and cocoa
32
33# 0.22.1 (2020-04-16)
34
35- On X11, fix `ResumeTimeReached` being fired too early.
36- On Web, replaced zero timeout for `ControlFlow::Poll` with `requestAnimationFrame`
37- On Web, fix a possible panic during event handling
38- On macOS, fix `EventLoopProxy` leaking memory for every instance.
39- On Windows, drag and drop can now be disabled with `WindowBuilderExtWindows::with_drag_and_drop(false)`.
40
41# 0.22.0 (2020-03-09)
42
43- On Windows, fix minor timing issue in wait_until_time_or_msg
44- On Windows, rework handling of request_redraw() to address panics.
45- On macOS, fix `set_simple_screen` to remember frame excluding title bar.
46- On Wayland, fix coordinates in touch events when scale factor isn't 1.
47- On Wayland, fix color from `close_button_icon_color` not applying.
48- Ignore locale if unsupported by X11 backend
49- On Wayland, Add HiDPI cursor support
50- On Web, add the ability to query "Light" or "Dark" system theme send `ThemeChanged` on change.
51- Fix `Event::to_static` returning `None` for user events.
52- On Wayland, Hide CSD for fullscreen windows.
53- On Windows, ignore spurious mouse move messages.
54- **Breaking:** Move `ModifiersChanged` variant from `DeviceEvent` to `WindowEvent`.
55- On Windows, add `IconExtWindows` trait which exposes creating an `Icon` from an external file or embedded resource
56- Add `BadIcon::OsError` variant for when OS icon functionality fails
57- On Windows, fix crash at startup on systems that do not properly support Windows' Dark Mode
58- Revert On macOS, fix not sending ReceivedCharacter event for specific keys combinations.
59- on macOS, fix incorrect ReceivedCharacter events for some key combinations.
60- **Breaking:** Use `i32` instead of `u32` for position type in `WindowEvent::Moved`.
61- On macOS, a mouse motion event is now generated before every mouse click.
62
63# 0.21.0 (2020-02-04)
64
65- On Windows, fixed "error: linking with `link.exe` failed: exit code: 1120" error on older versions of windows.
66- On macOS, fix set_minimized(true) works only with decorations.
67- On macOS, add `hide_application` to `EventLoopWindowTarget` via a new `EventLoopWindowTargetExtMacOS` trait. `hide_application` will hide the entire application by calling `-[NSApplication hide: nil]`.
68- On macOS, fix not sending ReceivedCharacter event for specific keys combinations.
69- On macOS, fix `CursorMoved` event reporting the cursor position using logical coordinates.
70- On macOS, fix issue where unbundled applications would sometimes open without being focused.
71- On macOS, fix `run_return` does not return unless it receives a message.
72- On Windows, fix bug where `RedrawRequested` would only get emitted every other iteration of the event loop.
73- On X11, fix deadlock on window state when handling certain window events.
74- `WindowBuilder` now implements `Default`.
75- **Breaking:** `WindowEvent::CursorMoved` changed to `f64` units, preserving high-precision data supplied by most backends
76- On Wayland, fix coordinates in mouse events when scale factor isn't 1
77- On Web, add the ability to provide a custom canvas
78- **Breaking:** On Wayland, the `WaylandTheme` struct has been replaced with a `Theme` trait, allowing for extra configuration
79
80# 0.20.0 (2020-01-05)
81
82- On X11, fix `ModifiersChanged` emitting incorrect modifier change events
83- **Breaking**: Overhaul how Winit handles DPI:
84  + Window functions and events now return `PhysicalSize` instead of `LogicalSize`.
85  + Functions that take `Size` or `Position` types can now take either `Logical` or `Physical` types.
86  + `hidpi_factor` has been renamed to `scale_factor`.
87  + `HiDpiFactorChanged` has been renamed to `ScaleFactorChanged`, and lets you control how the OS
88    resizes the window in response to the change.
89  + On X11, deprecate `WINIT_HIDPI_FACTOR` environment variable in favor of `WINIT_X11_SCALE_FACTOR`.
90  + `Size` and `Position` types are now generic over their exact pixel type.
91
92# 0.20.0 Alpha 6 (2020-01-03)
93
94- On macOS, fix `set_cursor_visible` hides cursor outside of window.
95- On macOS, fix `CursorEntered` and `CursorLeft` events fired at old window size.
96- On macOS, fix error when `set_fullscreen` is called during fullscreen transition.
97- On all platforms except mobile and WASM, implement `Window::set_minimized`.
98- On X11, fix `CursorEntered` event being generated for non-winit windows.
99- On macOS, fix crash when starting maximized without decorations.
100- On macOS, fix application not terminating on `run_return`.
101- On Wayland, fix cursor icon updates on window borders when using CSD.
102- On Wayland, under mutter(GNOME Wayland), fix CSD being behind the status bar, when starting window in maximized mode.
103- On Windows, theme the title bar according to whether the system theme is "Light" or "Dark".
104- Added `WindowEvent::ThemeChanged` variant to handle changes to the system theme. Currently only implemented on Windows.
105- **Breaking**: Changes to the `RedrawRequested` event (#1041):
106  - `RedrawRequested` has been moved from `WindowEvent` to `Event`.
107  - `EventsCleared` has been renamed to `MainEventsCleared`.
108  - `RedrawRequested` is now issued only after `MainEventsCleared`.
109  - `RedrawEventsCleared` is issued after each set of `RedrawRequested` events.
110- Implement synthetic window focus key events on Windows.
111- **Breaking**: Change `ModifiersState` to a `bitflags` struct.
112- On Windows, implement `VirtualKeyCode` translation for `LWin` and `RWin`.
113- On Windows, fix closing the last opened window causing `DeviceEvent`s to stop getting emitted.
114- On Windows, fix `Window::set_visible` not setting internal flags correctly. This resulted in some weird behavior.
115- Add `DeviceEvent::ModifiersChanged`.
116  - Deprecate `modifiers` fields in other events in favor of `ModifiersChanged`.
117- On X11, `WINIT_HIDPI_FACTOR` now dominates `Xft.dpi` when picking DPI factor for output.
118- 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`.
119
120# 0.20.0 Alpha 5 (2019-12-09)
121
122- On macOS, fix application termination on `ControlFlow::Exit`
123- On Windows, fix missing `ReceivedCharacter` events when Alt is held.
124- On macOS, stop emitting private corporate characters in `ReceivedCharacter` events.
125- On X11, fix misreporting DPI factor at startup.
126- On X11, fix events not being reported when using `run_return`.
127- On X11, fix key modifiers being incorrectly reported.
128- On X11, fix window creation hanging when another window is fullscreen.
129- On Windows, fix focusing unfocused windows when switching from fullscreen to windowed.
130- On X11, fix reporting incorrect DPI factor when waking from suspend.
131- Change `EventLoopClosed` to contain the original event.
132- **Breaking**: Add `is_synthetic` field to `WindowEvent` variant `KeyboardInput`,
133  indicating that the event is generated by winit.
134- On X11, generate synthetic key events for keys held when a window gains or loses focus.
135- On X11, issue a `CursorMoved` event when a `Touch` event occurs,
136  as X11 implicitly moves the cursor for such events.
137
138# 0.20.0 Alpha 4 (2019-10-18)
139
140- Add web support via the 'stdweb' or 'web-sys' features
141- On Windows, implemented function to get HINSTANCE
142- On macOS, implement `run_return`.
143- On iOS, fix inverted parameter in `set_prefers_home_indicator_hidden`.
144- On X11, performance is improved when rapidly calling `Window::set_cursor_icon`.
145- On iOS, fix improper `msg_send` usage that was UB and/or would break if `!` is stabilized.
146- On Windows, unset `maximized` when manually changing the window's position or size.
147- On Windows, add touch pressure information for touch events.
148- On macOS, differentiate between `CursorIcon::Grab` and `CursorIcon::Grabbing`.
149- On Wayland, fix event processing sometimes stalling when using OpenGL with vsync.
150- Officially remove the Emscripten backend.
151- On Windows, fix handling of surrogate pairs when dispatching `ReceivedCharacter`.
152- On macOS 10.15, fix freeze upon exiting exclusive fullscreen mode.
153- On iOS, fix panic upon closing the app.
154- On X11, allow setting mulitple `XWindowType`s.
155- On iOS, fix null window on initial `HiDpiFactorChanged` event.
156- On Windows, fix fullscreen window shrinking upon getting restored to a normal window.
157- On macOS, fix events not being emitted during modal loops, such as when windows are being resized
158  by the user.
159- On Windows, fix hovering the mouse over the active window creating an endless stream of CursorMoved events.
160- Always dispatch a `RedrawRequested` event after creating a new window.
161- On X11, return dummy monitor data to avoid panicking when no monitors exist.
162- On X11, prevent stealing input focus when creating a new window.
163  Only steal input focus when entering fullscreen mode.
164- On Wayland, fixed DeviceEvents for relative mouse movement is not always produced
165- On Wayland, add support for set_cursor_visible and set_cursor_grab.
166- On Wayland, fixed DeviceEvents for relative mouse movement is not always produced.
167- Removed `derivative` crate dependency.
168- On Wayland, add support for set_cursor_icon.
169- Use `impl Iterator<Item = MonitorHandle>` instead of `AvailableMonitorsIter` consistently.
170- On macOS, fix fullscreen state being updated after entering fullscreen instead of before,
171  resulting in `Window::fullscreen` returning the old state in `Resized` events instead of
172  reflecting the new fullscreen state
173- On X11, fix use-after-free during window creation
174- On Windows, disable monitor change keyboard shortcut while in exclusive fullscreen.
175- On Windows, ensure that changing a borderless fullscreen window's monitor via keyboard shortcuts keeps the window fullscreen on the new monitor.
176- Prevent `EventLoop::new` and `EventLoop::with_user_event` from getting called outside the main thread.
177  - This is because some platforms cannot run the event loop outside the main thread. Preventing this
178    reduces the potential for cross-platform compatibility gotchyas.
179- On Windows and Linux X11/Wayland, add platform-specific functions for creating an `EventLoop` outside the main thread.
180- On Wayland, drop resize events identical to the current window size.
181- On Windows, fix window rectangle not getting set correctly on high-DPI systems.
182
183# 0.20.0 Alpha 3 (2019-08-14)
184
185- On macOS, drop the run closure on exit.
186- On Windows, location of `WindowEvent::Touch` are window client coordinates instead of screen coordinates.
187- On X11, fix delayed events after window redraw.
188- On macOS, add `WindowBuilderExt::with_disallow_hidpi` to have the option to turn off best resolution openGL surface.
189- On Windows, screen saver won't start if the window is in fullscreen mode.
190- Change all occurrences of the `new_user_event` method to `with_user_event`.
191- On macOS, the dock and the menu bar are now hidden in fullscreen mode.
192- `Window::set_fullscreen` now takes `Option<Fullscreen>` where `Fullscreen`
193  consists of `Fullscreen::Exclusive(VideoMode)` and
194  `Fullscreen::Borderless(MonitorHandle)` variants.
195    - Adds support for exclusive fullscreen mode.
196- On iOS, add support for hiding the home indicator.
197- On iOS, add support for deferring system gestures.
198- On iOS, fix a crash that occurred while acquiring a monitor's name.
199- On iOS, fix armv7-apple-ios compile target.
200- Removed the `T: Clone` requirement from the `Clone` impl of `EventLoopProxy<T>`.
201- On iOS, disable overscan compensation for external displays (removes black
202  bars surrounding the image).
203- On Linux, the functions `is_wayland`, `is_x11`, `xlib_xconnection` and `wayland_display` have been moved to a new `EventLoopWindowTargetExtUnix` trait.
204- On iOS, add `set_prefers_status_bar_hidden` extension function instead of
205  hijacking `set_decorations` for this purpose.
206- On macOS and iOS, corrected the auto trait impls of `EventLoopProxy`.
207- On iOS, add touch pressure information for touch events.
208- Implement `raw_window_handle::HasRawWindowHandle` for `Window` type on all supported platforms.
209- On macOS, fix the signature of `-[NSView drawRect:]`.
210- On iOS, fix the behavior of `ControlFlow::Poll`. It wasn't polling if that was the only mode ever used by the application.
211- On iOS, fix DPI sent out by views on creation was `0.0` - now it gives a reasonable number.
212- On iOS, RedrawRequested now works for gl/metal backed views.
213- On iOS, RedrawRequested is generally ordered after EventsCleared.
214
215# 0.20.0 Alpha 2 (2019-07-09)
216
217- On X11, non-resizable windows now have maximize explicitly disabled.
218- On Windows, support paths longer than MAX_PATH (260 characters) in `WindowEvent::DroppedFile`
219and `WindowEvent::HoveredFile`.
220- On Mac, implement `DeviceEvent::Button`.
221- Change `Event::Suspended(true / false)` to `Event::Suspended` and `Event::Resumed`.
222- 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.
223- Revert the use of invisible surfaces in Wayland, which introduced graphical glitches with OpenGL (#835)
224- On X11, implement `_NET_WM_PING` to allow desktop environment to kill unresponsive programs.
225- On Windows, when a window is initially invisible, it won't take focus from the existing visible windows.
226- On Windows, fix multiple calls to `request_redraw` during `EventsCleared` sending multiple `RedrawRequested events.`
227- On Windows, fix edge case where `RedrawRequested` could be dispatched before input events in event loop iteration.
228- On Windows, fix timing issue that could cause events to be improperly dispatched after `RedrawRequested` but before `EventsCleared`.
229- On macOS, drop unused Metal dependency.
230- On Windows, fix the trail effect happening on transparent decorated windows. Borderless (or un-decorated) windows were not affected.
231- On Windows, fix `with_maximized` not properly setting window size to entire window.
232- On macOS, change `WindowExtMacOS::request_user_attention()` to take an `enum` instead of a `bool`.
233
234# 0.20.0 Alpha 1 (2019-06-21)
235
236- Changes below are considered **breaking**.
237- Change all occurrences of `EventsLoop` to `EventLoop`.
238- Previously flat API is now exposed through `event`, `event_loop`, `monitor`, and `window` modules.
239- `os` module changes:
240  - Renamed to `platform`.
241  - All traits now have platform-specific suffixes.
242  - Exposes new `desktop` module on Windows, Mac, and Linux.
243- Changes to event loop types:
244  - `EventLoopProxy::wakeup` has been removed in favor of `send_event`.
245  - **Major:** New `run` method drives winit event loop.
246    - Returns `!` to ensure API behaves identically across all supported platforms.
247      - This allows `emscripten` implementation to work without lying about the API.
248    - `ControlFlow`'s variants have been replaced with `Wait`, `WaitUntil(Instant)`, `Poll`, and `Exit`.
249      - Is read after `EventsCleared` is processed.
250      - `Wait` waits until new events are available.
251      - `WaitUntil` waits until either new events are available or the provided time has been reached.
252      - `Poll` instantly resumes the event loop.
253      - `Exit` aborts the event loop.
254    - Takes a closure that implements `'static + FnMut(Event<T>, &EventLoop<T>, &mut ControlFlow)`.
255      - `&EventLoop<T>` is provided to allow new `Window`s to be created.
256  - **Major:** `platform::desktop` module exposes `EventLoopExtDesktop` trait with `run_return` method.
257    - Behaves identically to `run`, but returns control flow to the calling context and can take non-`'static` closures.
258  - `EventLoop`'s `poll_events` and `run_forever` methods have been removed in favor of `run` and `run_return`.
259- Changes to events:
260  - Remove `Event::Awakened` in favor of `Event::UserEvent(T)`.
261    - Can be sent with `EventLoopProxy::send_event`.
262  - Rename `WindowEvent::Refresh` to `WindowEvent::RedrawRequested`.
263    - `RedrawRequested` can be sent by the user with the `Window::request_redraw` method.
264  - `EventLoop`, `EventLoopProxy`, and `Event` are now generic over `T`, for use in `UserEvent`.
265  - **Major:** Add `NewEvents(StartCause)`, `EventsCleared`, and `LoopDestroyed` variants to `Event`.
266    - `NewEvents` is emitted when new events are ready to be processed by event loop.
267      - `StartCause` describes why new events are available, with `ResumeTimeReached`, `Poll`, `WaitCancelled`, and `Init` (sent once at start of loop).
268    - `EventsCleared` is emitted when all available events have been processed.
269      - Can be used to perform logic that depends on all events being processed (e.g. an iteration of a game loop).
270    - `LoopDestroyed` is emitted when the `run` or `run_return` method is about to exit.
271- Rename `MonitorId` to `MonitorHandle`.
272- Removed `serde` implementations from `ControlFlow`.
273- Rename several functions to improve both internal consistency and compliance with Rust API guidelines.
274- Remove `WindowBuilder::multitouch` field, since it was only implemented on a few platforms. Multitouch is always enabled now.
275- **Breaking:** On macOS, change `ns` identifiers to use snake_case for consistency with iOS's `ui` identifiers.
276- Add `MonitorHandle::video_modes` method for retrieving supported video modes for the given monitor.
277- On Wayland, the window now exists even if nothing has been drawn.
278- On Windows, fix initial dimensions of a fullscreen window.
279- On Windows, Fix transparent borderless windows rendering wrong.
280
281# Version 0.19.1 (2019-04-08)
282
283- On Wayland, added a `get_wayland_display` function to `EventsLoopExt`.
284- On Windows, fix `CursorMoved(0, 0)` getting dispatched on window focus.
285- On macOS, fix command key event left and right reverse.
286- On FreeBSD, NetBSD, and OpenBSD, fix build of X11 backend.
287- On Linux, the numpad's add, subtract and divide keys are now mapped to the `Add`, `Subtract` and `Divide` virtual key codes
288- On macOS, the numpad's subtract key has been added to the `Subtract` mapping
289- 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
290- On Windows, fix icon not showing up in corner of window.
291- 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.
292
293# Version 0.19.0 (2019-03-06)
294
295- On X11, we will use the faster `XRRGetScreenResourcesCurrent` function instead of `XRRGetScreenResources` when available.
296- On macOS, fix keycodes being incorrect when using a non-US keyboard layout.
297- On Wayland, fix `with_title()` not setting the windows title
298- On Wayland, add `set_wayland_theme()` to control client decoration color theme
299- Added serde serialization to `os::unix::XWindowType`.
300- **Breaking:** Remove the `icon_loading` feature and the associated `image` dependency.
301- On X11, make event loop thread safe by replacing XNextEvent with select(2) and XCheckIfEvent
302- On Windows, fix malformed function pointer typecast that could invoke undefined behavior.
303- Refactored Windows state/flag-setting code.
304- On Windows, hiding the cursor no longer hides the cursor for all Winit windows - just the one `hide_cursor` was called on.
305- 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.
306- On Windows, only vertical mouse wheel events were handled. Now, horizontal mouse wheel events are also handled.
307- On Windows, ignore the AltGr key when populating the `ModifersState` type.
308
309# Version 0.18.1 (2018-12-30)
310
311- On macOS, fix `Yen` (JIS) so applications receive the event.
312- On X11 with a tiling WM, fixed high CPU usage when moving windows across monitors.
313- On X11, fixed panic caused by dropping the window before running the event loop.
314- on macOS, added `WindowExt::set_simple_fullscreen` which does not require a separate space
315- Introduce `WindowBuilderExt::with_app_id` to allow setting the application ID on Wayland.
316- 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.
317- On Windows, fix issue where resizing or moving window combined with grabbing the cursor would freeze program.
318- On Windows, fix issue where resizing or moving window would eat `Awakened` events.
319- On Windows, exiting fullscreen after entering fullscreen with disabled decorations no longer shrinks window.
320- On X11, fixed a segfault when using virtual monitors with XRandR.
321- Derive `Ord` and `PartialOrd` for `VirtualKeyCode` enum.
322- On Windows, fix issue where hovering or dropping a non file item would create a panic.
323- 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.
324- On Wayland, DPI calculation is handled by smithay-client-toolkit.
325- On X11, `WindowBuilder::with_min_dimensions` and `WindowBuilder::with_max_dimensions` now correctly account for DPI.
326- Added support for generating dummy `DeviceId`s and `WindowId`s to better support unit testing.
327- On macOS, fixed unsoundness in drag-and-drop that could result in drops being rejected.
328- On macOS, implemented `WindowEvent::Refresh`.
329- On macOS, all `MouseCursor` variants are now implemented and the cursor will no longer reset after unfocusing.
330- Removed minimum supported Rust version guarantee.
331
332# Version 0.18.0 (2018-11-07)
333
334- **Breaking:** `image` crate upgraded to 0.20. This is exposed as part of the `icon_loading` API.
335- On Wayland, pointer events will now provide the current modifiers state.
336- On Wayland, titles will now be displayed in the window header decoration.
337- On Wayland, key repetition is now ended when keyboard loses focus.
338- On Wayland, windows will now use more stylish and modern client side decorations.
339- On Wayland, windows will use server-side decorations when available.
340- **Breaking:** Added support for F16-F24 keys (variants were added to the `VirtualKeyCode` enum).
341- Fixed graphical glitches when resizing on Wayland.
342- On Windows, fix freezes when performing certain actions after a window resize has been triggered. Reintroduces some visual artifacts when resizing.
343- 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).
344- Added `WindowBuilderExt::with_gtk_theme_variant` to X11-specific `WindowBuilder` functions.
345- Fixed UTF8 handling bug in X11 `set_title` function.
346- On Windows, `Window::set_cursor` now applies immediately instead of requiring specific events to occur first.
347- On Windows, the `HoveredFile` and `HoveredFileCancelled` events are now implemented.
348- On Windows, fix `Window::set_maximized`.
349- On Windows 10, fix transparency (#260).
350- On macOS, fix modifiers during key repeat.
351- Implemented the `Debug` trait for `Window`, `EventsLoop`, `EventsLoopProxy` and `WindowBuilder`.
352- 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.
353- Added further clarifications to the DPI docs.
354- On Linux, if neither X11 nor Wayland manage to initialize, the corresponding panic now consists of a single line only.
355- Add optional `serde` feature with implementations of `Serialize`/`Deserialize` for DPI types and various event types.
356- Add `PartialEq`, `Eq`, and `Hash` implementations on public types that could have them but were missing them.
357- On X11, drag-and-drop receiving an unsupported drop type can no longer cause the WM to freeze.
358- Fix issue whereby the OpenGL context would not appear at startup on macOS Mojave (#1069).
359- **Breaking:** Removed `From<NSApplicationActivationPolicy>` impl from `ActivationPolicy` on macOS.
360- On macOS, the application can request the user's attention with `WindowExt::request_user_attention`.
361
362# Version 0.17.2 (2018-08-19)
363
364- On macOS, fix `<C-Tab>` so applications receive the event.
365- On macOS, fix `<Cmd-{key}>` so applications receive the event.
366- On Wayland, key press events will now be repeated.
367
368# Version 0.17.1 (2018-08-05)
369
370- On X11, prevent a compilation failure in release mode for versions of Rust greater than or equal to 1.30.
371- Fixed deadlock that broke fullscreen mode on Windows.
372
373# Version 0.17.0 (2018-08-02)
374
375- Cocoa and core-graphics updates.
376- Fixed thread-safety issues in several `Window` functions on Windows.
377- On MacOS, the key state for modifiers key events is now properly set.
378- 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.
379- Added NetBSD support.
380- **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).
381- On iOS, the `UIApplication` is not started until `Window::new` is called.
382- Fixed thread unsafety with cursor hiding on macOS.
383- On iOS, fixed the size of the `JmpBuf` type used for `setjmp`/`longjmp` calls. Previously this was a buffer overflow on most architectures.
384- On Windows, use cached window DPI instead of repeatedly querying the system. This fixes sporadic crashes on Windows 7.
385
386# Version 0.16.2 (2018-07-07)
387
388- On Windows, non-resizable windows now have the maximization button disabled. This is consistent with behavior on macOS and popular X11 WMs.
389- Corrected incorrect `unreachable!` usage when guessing the DPI factor with no detected monitors.
390
391# Version 0.16.1 (2018-07-02)
392
393- Added logging through `log`. Logging will become more extensive over time.
394- 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.
395- Fixed X11 backend compilation for environments where `c_char` is unsigned.
396
397# Version 0.16.0 (2018-06-25)
398
399- Windows additionally has `WindowBuilderExt::with_no_redirection_bitmap`.
400- **Breaking:** Removed `VirtualKeyCode::LMenu` and `VirtualKeyCode::RMenu`; Windows now generates `VirtualKeyCode::LAlt` and `VirtualKeyCode::RAlt` instead.
401- On X11, exiting fullscreen no longer leaves the window in the monitor's top left corner.
402- **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.
403- The Windows backend is now DPI aware. `WindowEvent::HiDpiFactorChanged` is implemented, and `MonitorId::get_hidpi_factor` and `Window::hidpi_factor` return accurate values.
404- Implemented `WindowEvent::HiDpiFactorChanged` on X11.
405- On macOS, `Window::set_cursor_position` is now relative to the client area.
406- On macOS, setting the maximum and minimum dimensions now applies to the client area dimensions rather than to the window dimensions.
407- On iOS, `MonitorId::get_dimensions` has been implemented and both `MonitorId::get_hidpi_factor` and `Window::get_hidpi_factor` return accurate values.
408- On Emscripten, `MonitorId::get_hidpi_factor` now returns the same value as `Window::get_hidpi_factor` (it previously would always return 1.0).
409- **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.
410- **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.
411- HiDPI support for Wayland.
412- `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.
413- `AvailableMonitorsIter` now implements `Debug`.
414- Fixed quirk on macOS where certain keys would generate characters at twice the normal rate when held down.
415- On X11, all event loops now share the same `XConnection`.
416- **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.
417- **Breaking:** `Window::set_cursor_position` now returns `Result<(), String>`, thus allowing for `Box<Error>` conversion via `?`.
418
419# Version 0.15.1 (2018-06-13)
420
421- On X11, the `Moved` event is no longer sent when the window is resized without changing position.
422- `MouseCursor` and `CursorState` now implement `Default`.
423- `WindowBuilder::with_resizable` implemented for Windows, X11, Wayland, and macOS.
424- `Window::set_resizable` implemented for Windows, X11, Wayland, and macOS.
425- On X11, if the monitor's width or height in millimeters is reported as 0, the DPI is now 1.0 instead of +inf.
426- On X11, the environment variable `WINIT_HIDPI_FACTOR` has been added for overriding DPI factor.
427- On X11, enabling transparency no longer causes the window contents to flicker when resizing.
428- On X11, `with_override_redirect` now actually enables override redirect.
429- macOS now generates `VirtualKeyCode::LAlt` and `VirtualKeyCode::RAlt` instead of `None` for both.
430- On macOS, `VirtualKeyCode::RWin` and `VirtualKeyCode::LWin` are no longer switched.
431- On macOS, windows without decorations can once again be resized.
432- Fixed race conditions when creating an `EventsLoop` on X11, most commonly manifesting as "[xcb] Unknown sequence number while processing queue".
433- On macOS, `CursorMoved` and `MouseInput` events are only generated if they occurs within the window's client area.
434- On macOS, resizing the window no longer generates a spurious `MouseInput` event.
435
436# Version 0.15.0 (2018-05-22)
437
438- `Icon::to_cardinals` is no longer public, since it was never supposed to be.
439- Wayland: improve diagnostics if initialization fails
440- Fix some system event key doesn't work when focused, do not block keyevent forward to system on macOS
441- On X11, the scroll wheel position is now correctly reset on i3 and other WMs that have the same quirk.
442- On X11, `Window::get_current_monitor` now reliably returns the correct monitor.
443- On X11, `Window::hidpi_factor` returns values from XRandR rather than the inaccurate values previously queried from the core protocol.
444- On X11, the primary monitor is detected correctly even when using versions of XRandR less than 1.5.
445- `MonitorId` now implements `Debug`.
446- Fixed bug on macOS where using `with_decorations(false)` would cause `set_decorations(true)` to produce a transparent titlebar with no title.
447- Implemented `MonitorId::get_position` on macOS.
448- On macOS, `Window::get_current_monitor` now returns accurate values.
449- Added `WindowBuilderExt::with_resize_increments` to macOS.
450- **Breaking:** On X11, `WindowBuilderExt::with_resize_increments` and `WindowBuilderExt::with_base_size` now take `u32` values rather than `i32`.
451- 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.
452- Added the `Window::set_ime_spot(x: i32, y: i32)` method, which is implemented on X11 and macOS.
453- **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.
454- Fixed detection of `Pause` and `Scroll` keys on Windows.
455- On Windows, alt-tabbing while the cursor is grabbed no longer makes it impossible to re-grab the cursor.
456- On Windows, using `CursorState::Hide` when the cursor is grabbed now ungrabs the cursor first.
457- Implemented `MouseCursor::NoneCursor` on Windows.
458- Added `WindowBuilder::with_always_on_top` and `Window::set_always_on_top`. Implemented on Windows, macOS, and X11.
459- 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`.
460- 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`.
461
462# Version 0.14.0 (2018-05-09)
463
464- Created the `Copy`, `Paste` and `Cut` `VirtualKeyCode`s and added support for them on X11 and Wayland
465- Fix `.with_decorations(false)` in macOS
466- 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.
467- Fix regression of Window platform extensions for macOS where `NSFullSizeContentViewWindowMask` was not being correctly applied to `.fullsize_content_view`.
468- Corrected `get_position` on Windows to be relative to the screen rather than to the taskbar.
469- 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`).
470- Implemented `Moved` event on macOS.
471- 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.
472- 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.
473- `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.
474- Corrected `run_forever` on X11 to stop discarding `Awakened` events.
475- Various safety and correctness improvements to the X11 backend internals.
476- Fixed memory leak on X11 every time the mouse entered the window.
477- On X11, drag and drop now works reliably in release mode.
478- Added `WindowBuilderExt::with_resize_increments` and `WindowBuilderExt::with_base_size` to X11, allowing for more optional hints to be set.
479- Rework of the wayland backend, migrating it to use [Smithay's Client Toolkit](https://github.com/Smithay/client-toolkit).
480- 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.
481- Windows additionally has `WindowBuilderExt::with_taskbar_icon` and `WindowExt::set_taskbar_icon`.
482- On Windows, fix panic when trying to call `set_fullscreen(None)` on a window that has not been fullscreened prior.
483
484# Version 0.13.1 (2018-04-26)
485
486- Ensure necessary `x11-dl` version is used.
487
488# Version 0.13.0 (2018-04-25)
489
490- Implement `WindowBuilder::with_maximized`, `Window::set_fullscreen`, `Window::set_maximized` and `Window::set_decorations` for MacOS.
491- Implement `WindowBuilder::with_maximized`, `Window::set_fullscreen`, `Window::set_maximized` and `Window::set_decorations` for Windows.
492- On Windows, `WindowBuilder::with_fullscreen` no longer changing monitor display resolution.
493- 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.
494- Fixed SIGSEGV/SIGILL crashes on macOS caused by stabilization of the `!` (never) type.
495- Implement `WindowEvent::HiDPIFactorChanged` for macOS
496- 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.
497- Implemented `Refresh` event on Windows.
498- Properly calculate the minimum and maximum window size on Windows, including window decorations.
499- Map more `MouseCursor` variants to cursor icons on Windows.
500- Corrected `get_position` on macOS to return outer frame position, not content area position.
501- Corrected `set_position` on macOS to set outer frame position, not content area position.
502- 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).
503- **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`.
504
505# Version 0.12.0 (2018-04-06)
506
507- Added subclass to macos windows so they can be made resizable even with no decorations.
508- Dead keys now work properly on X11, no longer resulting in a panic.
509- 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.
510- Fixed thread safety issues with input methods on X11.
511- Add support for `Touch` for win32 backend.
512- Fixed `Window::get_inner_size` and friends to return the size in pixels instead of points when using HIDPI displays on OSX.
513
514# Version 0.11.3 (2018-03-28)
515
516- Added `set_min_dimensions` and `set_max_dimensions` methods to `Window`, and implemented on Windows, X11, Wayland, and OSX.
517- 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.
518- Added `WindowBuilderExt` methods for macos: `with_titlebar_transparent`,
519  `with_title_hidden`, `with_titlebar_buttons_hidden`,
520  `with_fullsize_content_view`.
521- Mapped X11 numpad keycodes (arrows, Home, End, PageUp, PageDown, Insert and Delete) to corresponding virtual keycodes
522
523# Version 0.11.2 (2018-03-06)
524
525- Impl `Hash`, `PartialEq`, and `Eq` for `events::ModifiersState`.
526- Implement `MonitorId::get_hidpi_factor` for MacOS.
527- Added method `os::macos::MonitorIdExt::get_nsscreen() -> *mut c_void` that gets a `NSScreen` object matching the monitor ID.
528- Send `Awakened` event on Android when event loop is woken up.
529
530# Version 0.11.1 (2018-02-19)
531
532- Fixed windows not receiving mouse events when click-dragging the mouse outside the client area of a window, on Windows platforms.
533- Added method `os::android::EventsLoopExt:set_suspend_callback(Option<Box<Fn(bool) -> ()>>)` that allows glutin to register a callback when a suspend event happens
534
535# Version 0.11.0 (2018-02-09)
536
537- Implement `MonitorId::get_dimensions` for Android.
538- Added method `os::macos::WindowBuilderExt::with_movable_by_window_background(bool)` that allows to move a window without a titlebar - `with_decorations(false)`
539- Implement `Window::set_fullscreen`, `Window::set_maximized` and `Window::set_decorations` for Wayland.
540- Added `Caret` as VirtualKeyCode and support OSX ^-Key with german input.
541
542# Version 0.10.1 (2018-02-05)
543
544*Yanked*
545
546# Version 0.10.0 (2017-12-27)
547
548- Add support for `Touch` for emscripten backend.
549- Added support for `DroppedFile`, `HoveredFile`, and `HoveredFileCancelled` to X11 backend.
550- **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.
551- Added `set_decorations` method to `Window` to allow decorations to be toggled after the window is built. Presently only implemented on X11.
552- 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.
553- Added `modifiers` field to `MouseInput`, `MouseWheel`, and `CursorMoved` events to track the modifiers state (`ModifiersState`).
554- Fixed the emscripten backend to return the size of the canvas instead of the size of the window.
555
556# Version 0.9.0 (2017-12-01)
557
558- Added event `WindowEvent::HiDPIFactorChanged`.
559- Added method `MonitorId::get_hidpi_factor`.
560- Deprecated `get_inner_size_pixels` and `get_inner_size_points` methods of `Window` in favor of
561`get_inner_size`.
562- **Breaking:** `EventsLoop` is `!Send` and `!Sync` because of platform-dependant constraints,
563  but `Window`, `WindowId`, `DeviceId` and `MonitorId` guaranteed to be `Send`.
564- `MonitorId::get_position` now returns `(i32, i32)` instead of `(u32, u32)`.
565- Rewrite of the wayland backend to use wayland-client-0.11
566- Support for dead keys on wayland for keyboard utf8 input
567- Monitor enumeration on Windows is now implemented using `EnumDisplayMonitors` instead of
568`EnumDisplayDevices`. This changes the value returned by `MonitorId::get_name()`.
569- On Windows added `MonitorIdExt::hmonitor` method
570- Impl `Clone` for `EventsLoopProxy`
571- `EventsLoop::get_primary_monitor()` on X11 will fallback to any available monitor if no primary is found
572- Support for touch event on wayland
573- `WindowEvent`s `MouseMoved`, `MouseEntered`, and `MouseLeft` have been renamed to
574`CursorMoved`, `CursorEntered`, and `CursorLeft`.
575- New `DeviceEvent`s added, `MouseMotion` and `MouseWheel`.
576- Send `CursorMoved` event after `CursorEntered` and `Focused` events.
577- Add support for `ModifiersState`, `MouseMove`, `MouseInput`, `MouseMotion` for emscripten backend.
578
579# Version 0.8.3 (2017-10-11)
580
581- Fixed issue of calls to `set_inner_size` blocking on Windows.
582- Mapped `ISO_Left_Tab` to `VirtualKeyCode::Tab` to make the key work with modifiers
583- Fixed the X11 backed on 32bit targets
584
585# Version 0.8.2 (2017-09-28)
586
587- Uniformize keyboard scancode values accross Wayland and X11 (#297).
588- Internal rework of the wayland event loop
589- Added method `os::linux::WindowExt::is_ready`
590
591# Version 0.8.1 (2017-09-22)
592
593- Added various methods to `os::linux::EventsLoopExt`, plus some hidden items necessary to make
594  glutin work.
595
596# Version 0.8.0 (2017-09-21)
597
598- Added `Window::set_maximized`, `WindowAttributes::maximized` and `WindowBuilder::with_maximized`.
599- Added `Window::set_fullscreen`.
600- Changed `with_fullscreen` to take a `Option<MonitorId>` instead of a `MonitorId`.
601- Removed `MonitorId::get_native_identifer()` in favor of platform-specific traits in the `os`
602  module.
603- Changed `get_available_monitors()` and `get_primary_monitor()` to be methods of `EventsLoop`
604  instead of stand-alone methods.
605- Changed `EventsLoop` to be tied to a specific X11 or Wayland connection.
606- Added a `os::linux::EventsLoopExt` trait that makes it possible to configure the connection.
607- Fixed the emscripten code, which now compiles.
608- Changed the X11 fullscreen code to use `xrandr` instead of `xxf86vm`.
609- Fixed the Wayland backend to produce `Refresh` event after window creation.
610- Changed the `Suspended` event to be outside of `WindowEvent`.
611- Fixed the X11 backend sometimes reporting the wrong virtual key (#273).
612