* Modify DPI API publicly and on Windows
* Add generic Position and make dpi creation functions const
* Make examples work
* Fix fullscreen windows not appearing
* Replace Logical coordinates in window events with Physical coordinates
* Update HiDpiFactorChanged
* Document to_static
* Added some "how" and "why" docs to event handling.
Basically I had these questions when I started exploring the new
event API's, and as I figured out the answers I put down more info
about how everything works. This is not final, and suggestions
are welcome -- the code example in the `event` module docs is
particularly dubious, but it's how I'm used to thinking abou things
so it only made sense to me once I wrote that.
Note that my bias is towards using winit for writing games, so that's
the sort of things I was interested in. This may not be valid for
more general use cases.
* cargo fmt
* Fix minor typos
* Revise event documentation
* Update lib.rs docs
* Update root docs
Co-authored-by: Osspial <osspial@gmail.com>
* On X11, make `WINIT_HIDPI_FACTOR` dominate `Xft.dpi` in some cases
This commit makes `WINIT_HIDPI_FACTOR` dominate `Xft.dpi` in general and
adds a special value `0` for `WINIT_HIDPI_FACTOR` to use winit computed
DPI factor with randr over Xft.dpi.
* Use `randr` instead of `0` for auto dpi scaling
* Update CHANGELOG
* blow up on wrong env var
* Allow empty string for env var
* Move DeviceEvent handling to the message target window.
Previously, device events seem to have only been sent to one particular
window, and when that window was closed Winit would stop receiving
device events. This also allows users to create windowless event loops
that process device events - an intriguing idea, to say the least.
* Emit LWin and RWin VirtualKeyCodes on Windows
* Implement ModifiersChanged on Windows
* Make ModifiersChanged a tuple variant instead of a struct variant
* Add changelog entries
* Format
* Update changelog entry
* Fix AltGr handling
* Reformat
* Publicly expose ModifiersChanged and deprecate misc. modifiers fields
* Change ModifiersState to a bitflags struct
* Make examples work
* Add modifier state methods
* all things considered, only erroring out in one file throughout all of these changes is kinda impressive
* Make expansion plans more clear
* Move changelog entry
* Try to fix macos build
* Revert modifiers println in cursor_grab
* Make serde serialization less bug-prone
* X11: Sync key press/release with window focus
* When a window loses focus, key release events are issued for all pressed keys
* When a window gains focus, key press events are issued for all pressed keys
* Adds `is_synthetic` field to `WindowEvent` variant `KeyboardInput`
to indicate that these events are synthetic.
* Adds `is_synthetic: false` to `WindowEvent::KeyboardInput` events issued
on all other platforms
* Implement windows focus key press/release on Windows
* Docs
Co-authored-by: Murarth <murarth@gmail.com>
* Register windowWillExitFullScreen
* On macOS: Do not toggle fullscreen during fullscreen transition
* Add CHANGELOG
Co-authored-by: Freya Gentz <zegentzy@protonmail.com>
* Add support for Windows Dark Mode
* Add is_dark_mode() getter to WindowExtWindows
* Add WindowEvent::DarkModeChanged
* Add support for dark mode in Windows 10 builds > 18362
* Change strategy for querying windows 10 build version
* Drop window state before sending event
Co-Authored-By: daxpedda <daxpedda@gmail.com>
* Change implementation of windows dark mode support
* Expand supported range of windows 10 versions with dark mode
* Use get_function! macro where possible
* Minor style fixes
* Improve documentation for ThemeChanged
* Use `as` conversion for `BOOL`
* Correct CHANGELOG entry for dark mode
Co-authored-by: daxpedda <daxpedda@gmail.com>
Co-authored-by: Osspial <osspial@gmail.com>
* Implement revamped `RedrawRequested` on iOS
* Added RedrawEventsCleared to events_cleared logic
* Fixed from comments
* Added RedrawEventsCleared to draw_rect handler.
* Fixed out of order `RedrawEventsCleared` events.
* cargo fmt
* Implement changes to `RedrawRequested` event
Implements the changes described in #1041 for the X11 platform and for
platform-independent public-facing code.
* Fix `request_redraw` example
* Fix examples in lib docs
* Only issue `RedrawRequested` on final `Expose` event
Mutter can reposition window on resize, if it is behind mutter's "bounding box".
So, when you start winit window in maximized mode with CSD, mutter places its CSD
behind the GNOME's status bar initially, and then sends configure with the
exact same size as your current window. If winit decides to optimize calling
frame.resize(..) in this case, we won't call set_geometry(we're calling
it through resize) and GNOME won't reposition your window to be inside the
"bounding box", which is not a desired behavior for the end user.
* Add ModifiersChanged event for macOS
This implements the macOS portion of #1124.
* Fix ModifiersChanged event import
* Fix event passing window instead of device id
* X11: Report `CursorMoved` when touch event occurs
* Only trigger CursorMoved events for the first touch ID
* Fix testing for current touch events
* Fix first touch logic
* X11: Sync key press/release with window focus
* When a window loses focus, key release events are issued for all pressed keys
* When a window gains focus, key press events are issued for all pressed keys
* Adds `is_synthetic` field to `WindowEvent` variant `KeyboardInput`
to indicate that these events are synthetic.
* Adds `is_synthetic: false` to `WindowEvent::KeyboardInput` events issued
on all other platforms
* Clarify code with comments