From 581b22e6a026ac92589be2f36a30357600f9d02c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 14 Feb 2023 13:23:29 +0100 Subject: [PATCH] Move warning to correct location (#3484) It seems that where it was, it warned about the context being recreated in every case, no matter whether the context would actually be recreated or not. --- wgpu-hal/src/gles/egl.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index b66047c1ec..b9eac71193 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -803,18 +803,19 @@ impl crate::Instance for Instance { } #[cfg(not(feature = "emscripten"))] (Rwh::Wayland(_), raw_window_handle::RawDisplayHandle::Wayland(display_handle)) => { - /* Wayland displays are not sharable between surfaces so if the - * surface we receive from this handle is from a different - * display, we must re-initialize the context. - * - * See gfx-rs/gfx#3545 - */ - log::warn!("Re-initializing Gles context due to Wayland window"); if inner .wl_display .map(|ptr| ptr != display_handle.display) .unwrap_or(true) { + /* Wayland displays are not sharable between surfaces so if the + * surface we receive from this handle is from a different + * display, we must re-initialize the context. + * + * See gfx-rs/gfx#3545 + */ + log::warn!("Re-initializing Gles context due to Wayland window"); + use std::ops::DerefMut; let display_attributes = [egl::ATTRIB_NONE];