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!
This commit is contained in:
Wez Furlong committed 2019-02-20 07:05:35 -08:00
1 parent 36be587bb9
commit 50a882874a
1 file changed
+3
+3
View File
@@ -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,