From eb958e5e64180a1b460e6991fec33e52bd8048b6 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:34:50 +0900 Subject: [PATCH] Update wgpu_integration.rs --- crates/eframe/src/native/wgpu_integration.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/eframe/src/native/wgpu_integration.rs b/crates/eframe/src/native/wgpu_integration.rs index 073fc7996c3..28ab79d44e8 100644 --- a/crates/eframe/src/native/wgpu_integration.rs +++ b/crates/eframe/src/native/wgpu_integration.rs @@ -647,7 +647,7 @@ impl WgpuWinitRunning { viewports, painter, viewport_from_window, - focused_viewport, + .. } = &mut *shared_mut; let FullOutput { @@ -675,8 +675,6 @@ impl WgpuWinitRunning { return EventResult::Wait; }; - egui_winit.handle_platform_output(window, platform_output); - let clipped_primitives = egui_ctx.tessellate(shapes, pixels_per_point); let screenshot_requested = viewport @@ -728,13 +726,14 @@ impl WgpuWinitRunning { integration.post_rendering(window); + egui_winit.handle_platform_output(window, platform_output); + handle_viewport_output( &integration.egui_ctx, &viewport_output, viewports, painter, viewport_from_window, - *focused_viewport, ); let window = viewport_from_window @@ -1001,7 +1000,6 @@ fn render_immediate_viewport( viewports, painter, viewport_from_window, - focused_viewport, .. } = &mut *shared_mut; @@ -1041,7 +1039,6 @@ fn render_immediate_viewport( viewports, painter, viewport_from_window, - *focused_viewport, ); } @@ -1066,7 +1063,6 @@ fn handle_viewport_output( viewports: &mut ViewportIdMap, painter: &mut egui_wgpu::winit::Painter, viewport_from_window: &mut HashMap, - focused_viewport: Option, ) { for ( viewport_id, @@ -1088,7 +1084,6 @@ fn handle_viewport_output( if let Some(window) = viewport.window.as_ref() { let old_inner_size = window.inner_size(); - let is_viewport_focused = focused_viewport == Some(viewport_id); viewport.deferred_commands.append(&mut commands); egui_winit::process_viewport_commands( @@ -1096,7 +1091,6 @@ fn handle_viewport_output( &mut viewport.info, std::mem::take(&mut viewport.deferred_commands), window, - is_viewport_focused, &mut viewport.actions_requested, );