From 5f503f034a85fae4cfd6aa17984b8797b914c75c Mon Sep 17 00:00:00 2001 From: Alan Jeffrey Date: Fri, 20 Sep 2019 10:01:50 -0500 Subject: [PATCH] Don't completely trust servo's tracking of the GL context in glutin --- ports/glutin/context.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/glutin/context.rs b/ports/glutin/context.rs index c26db664b94..a36e3f9c4e5 100644 --- a/ports/glutin/context.rs +++ b/ports/glutin/context.rs @@ -35,6 +35,13 @@ impl GlContext { *self = match std::mem::replace(self, GlContext::None) { GlContext::Current(c) => { warn!("Making an already current context current"); + // Servo thinks that that this window is current, + // but it might be wrong, since other code may have + // changed the current GL context. Just to be on + // the safe side, we make it current anyway. + let c = unsafe { + c.make_current().expect("Couldn't make window current") + }; GlContext::Current(c) }, GlContext::NotCurrent(c) => {