From 99699ea70c384ee80c6c0d3a8714e8f356175038 Mon Sep 17 00:00:00 2001 From: Alan Jeffrey Date: Fri, 20 Sep 2019 10:02:27 -0500 Subject: [PATCH] Make the current window not current while creating a new shared window in the glutin port --- ports/glutin/headed_window.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/glutin/headed_window.rs b/ports/glutin/headed_window.rs index 0e5c54e2551..2d1dd3ef2aa 100644 --- a/ports/glutin/headed_window.rs +++ b/ports/glutin/headed_window.rs @@ -133,6 +133,11 @@ impl Window { context.window().set_window_icon(Some(load_icon(icon_bytes))); } + if let Some(sharing) = sharing { + debug!("Making window {:?} not current", sharing.gl_context.borrow().window().id()); + sharing.gl_context.borrow_mut().make_not_current(); + } + let context = unsafe { debug!("Making window {:?} current", context.window().id()); context.make_current().expect("Couldn't make window current")