Skip to content

Commit e349038

Browse files
authored
Update glow_integration.rs
1 parent 676cf46 commit e349038

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

crates/eframe/src/native/glow_integration.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,6 @@ impl GlowWinitRunning {
689689
return EventResult::Wait;
690690
};
691691

692-
egui_winit.handle_platform_output(window, platform_output);
693-
694692
let clipped_primitives = integration.egui_ctx.tessellate(shapes, pixels_per_point);
695693

696694
{
@@ -775,6 +773,8 @@ impl GlowWinitRunning {
775773
}
776774
}
777775

776+
egui_winit.handle_platform_output(&window, platform_output);
777+
778778
glutin.handle_viewport_output(event_loop, &integration.egui_ctx, &viewport_output);
779779

780780
integration.report_frame_time(frame_timer.total_time_sec()); // don't count auto-save time as part of regular frame time
@@ -885,22 +885,24 @@ fn change_gl_context(
885885
) {
886886
crate::profile_function!();
887887

888-
let Some(p_current_gl_context) = current_gl_context.take() else {
889-
return;
890-
};
891-
892888
if !cfg!(target_os = "windows") {
893889
// According to https://github.com/emilk/egui/issues/4289
894890
// we cannot do this early-out on Windows.
895891
// TODO(emilk): optimize context switching on Windows too.
896892
// See https://github.com/emilk/egui/issues/4173
897893

898-
crate::profile_scope!("is_current");
899-
if gl_surface.is_current(&p_current_gl_context) {
900-
return; // Early-out to save a lot of time.
894+
if let Some(current_gl_context) = current_gl_context {
895+
crate::profile_scope!("is_current");
896+
if gl_surface.is_current(current_gl_context) {
897+
return; // Early-out to save a lot of time.
898+
}
901899
}
902900
}
903901

902+
let Some(p_current_gl_context) = current_gl_context.take() else {
903+
return;
904+
};
905+
904906
crate::profile_scope!("make_not_current");
905907
let Ok(not_current) = p_current_gl_context.make_not_current() else {
906908
return;
@@ -1313,15 +1315,13 @@ impl GlutinWindowContext {
13131315
if let Some(window) = &viewport.window {
13141316
let old_inner_size = window.inner_size();
13151317

1316-
let is_viewport_focused = self.focused_viewport == Some(viewport_id);
13171318
viewport.deferred_commands.append(&mut commands);
13181319

13191320
egui_winit::process_viewport_commands(
13201321
egui_ctx,
13211322
&mut viewport.info,
13221323
std::mem::take(&mut viewport.deferred_commands),
13231324
window,
1324-
is_viewport_focused,
13251325
&mut viewport.actions_requested,
13261326
);
13271327

0 commit comments

Comments
 (0)