diff options
author | 2021-03-24 05:29:19 +0100 | |
---|---|---|
committer | 2021-03-24 05:29:19 +0100 | |
commit | 2b520ca0984486d3ad930873837df8c819bab30c (patch) | |
tree | aa048b599703f20e18349b78aeb81e88db055e6e /glutin | |
parent | d66a34b27272ed9d6c143483b0a700468b00e311 (diff) | |
download | iced-2b520ca0984486d3ad930873837df8c819bab30c.tar.gz iced-2b520ca0984486d3ad930873837df8c819bab30c.tar.bz2 iced-2b520ca0984486d3ad930873837df8c819bab30c.zip |
Convert `ScaleFactorChanged` into `Resized` events in `iced_glutin`
... instead of just dropping them when calling `to_static`.
Diffstat (limited to 'glutin')
-rw-r--r-- | glutin/src/application.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/glutin/src/application.rs b/glutin/src/application.rs index 3a08104e..163bc9f9 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -107,7 +107,22 @@ where return; } - if let Some(event) = event.to_static() { + let event = match event { + glutin::event::Event::WindowEvent { + event: + glutin::event::WindowEvent::ScaleFactorChanged { + new_inner_size, + .. + }, + window_id, + } => Some(glutin::event::Event::WindowEvent { + event: glutin::event::WindowEvent::Resized(*new_inner_size), + window_id, + }), + _ => event.to_static(), + }; + + if let Some(event) = event { sender.start_send(event).expect("Send event"); let poll = instance.as_mut().poll(&mut context); |