From 50a882874ad2f33cca4dca496133b17ffdff8201 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 20 Feb 2019 07:05:35 -0800 Subject: [PATCH] ensure we're using a current context when querying surface dimenions https://github.com/wez/wezterm/issues/19 is a case where a user runs in this; it seems particular to their opengl implementation so I can't reproduce it locally. @Lompik suggests that this resolves the issue, and it doesn't seem to hurt, so let's apply it! --- src/xwindows/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xwindows/mod.rs b/src/xwindows/mod.rs index f2ede665d..540e1cf4c 100644 --- a/src/xwindows/mod.rs +++ b/src/xwindows/mod.rs @@ -378,6 +378,9 @@ unsafe impl glium::backend::Backend for GlState { } fn get_framebuffer_dimensions(&self) -> (u32, u32) { + unsafe { + self.make_current(); + } ( self.surface.query_width().unwrap() as u32, self.surface.query_height().unwrap() as u32,