mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-12 00:46:57 -06:00
* Issue #324: vendor winit 0.30.13 as published The crate as released on crates.io, without its asset files (docs/res/*.svg and examples/data/*.png, AGENTS.md §1). Not used yet: the next commit patches it and adds it to [patch.crates-io]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Issue #324: on Windows 11, a window dragged to another monitor takes its scale winit 0.30.13 handles WM_DPICHANGED by checking that the new window rect is on the monitor `MonitorFromWindow` names. During a drag that is still the monitor being left, so winit nudged the window back onto it, which sent another WM_DPICHANGED: the window grew and stayed on the wrong monitor at the wrong scale. From Windows 11 (build 22000) on, apply the rect Windows suggests, as winit master does since 488c036a (rust-windowing/winit#4341); no 0.30 release has it. Windows 10 keeps the old adjustment, as on winit master. The vendored copy goes in [patch.crates-io]; a test fails if winit resolves from crates.io again or the vendored copy loses the patch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.3 KiB
Rust
36 lines
1.3 KiB
Rust
use crate::event::KeyEvent;
|
|
use crate::keyboard::Key;
|
|
|
|
/// Additional methods for the `KeyEvent` which cannot be implemented on all
|
|
/// platforms.
|
|
pub trait KeyEventExtModifierSupplement {
|
|
/// Identical to `KeyEvent::text` but this is affected by <kbd>Ctrl</kbd>.
|
|
///
|
|
/// For example, pressing <kbd>Ctrl</kbd>+<kbd>a</kbd> produces `Some("\x01")`.
|
|
fn text_with_all_modifiers(&self) -> Option<&str>;
|
|
|
|
/// This value ignores all modifiers including,
|
|
/// but not limited to <kbd>Shift</kbd>, <kbd>Caps Lock</kbd>,
|
|
/// and <kbd>Ctrl</kbd>. In most cases this means that the
|
|
/// unicode character in the resulting string is lowercase.
|
|
///
|
|
/// This is useful for key-bindings / shortcut key combinations.
|
|
///
|
|
/// In case `logical_key` reports `Dead`, this will still report the
|
|
/// key as `Character` according to the current keyboard layout. This value
|
|
/// cannot be `Dead`.
|
|
fn key_without_modifiers(&self) -> Key;
|
|
}
|
|
|
|
impl KeyEventExtModifierSupplement for KeyEvent {
|
|
#[inline]
|
|
fn text_with_all_modifiers(&self) -> Option<&str> {
|
|
self.platform_specific.text_with_all_modifiers.as_ref().map(|s| s.as_str())
|
|
}
|
|
|
|
#[inline]
|
|
fn key_without_modifiers(&self) -> Key {
|
|
self.platform_specific.key_without_modifiers.clone()
|
|
}
|
|
}
|