Skip to content

Commit

Permalink
Update wgpu_integration.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Jun 16, 2024
1 parent e349038 commit eb958e5
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions crates/eframe/src/native/wgpu_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ impl WgpuWinitRunning {
viewports,
painter,
viewport_from_window,
focused_viewport,
..
} = &mut *shared_mut;

let FullOutput {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1001,7 +1000,6 @@ fn render_immediate_viewport(
viewports,
painter,
viewport_from_window,
focused_viewport,
..
} = &mut *shared_mut;

Expand Down Expand Up @@ -1041,7 +1039,6 @@ fn render_immediate_viewport(
viewports,
painter,
viewport_from_window,
*focused_viewport,
);
}

Expand All @@ -1066,7 +1063,6 @@ fn handle_viewport_output(
viewports: &mut ViewportIdMap<Viewport>,
painter: &mut egui_wgpu::winit::Painter,
viewport_from_window: &mut HashMap<WindowId, ViewportId>,
focused_viewport: Option<ViewportId>,
) {
for (
viewport_id,
Expand All @@ -1088,15 +1084,13 @@ 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(
egui_ctx,
&mut viewport.info,
std::mem::take(&mut viewport.deferred_commands),
window,
is_viewport_focused,
&mut viewport.actions_requested,
);

Expand Down

0 comments on commit eb958e5

Please sign in to comment.