From 2b520ca0984486d3ad930873837df8c819bab30c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 24 Mar 2021 05:29:19 +0100 Subject: Convert `ScaleFactorChanged` into `Resized` events in `iced_glutin` ... instead of just dropping them when calling `to_static`. --- glutin/src/application.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'glutin') 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); -- cgit