diff --git a/src/guiloop/mod.rs b/src/guiloop/mod.rs index b80dfd6ad..807c4cef2 100644 --- a/src/guiloop/mod.rs +++ b/src/guiloop/mod.rs @@ -27,10 +27,6 @@ impl Default for GuiSelection { } } -thread_local! { - static GUI_SYSTEM: RefCell>> = RefCell::new(None); -} - impl GuiSelection { pub fn try_new(self, mux: &Rc) -> Result, Error> { let system = match self { @@ -40,28 +36,9 @@ impl GuiSelection { #[cfg(not(all(unix, not(target_os = "macos"))))] GuiSelection::X11 => bail!("X11 not compiled in"), }; - - if let Ok(sys) = &system { - GUI_SYSTEM.with(|g| { - *g.borrow_mut() = Some(Rc::clone(&sys)); - }); - } - system } - /// Returns a reference to the gui system. - /// Will return None if not called on the gui thread. - pub fn get() -> Option> { - let mut res = None; - GUI_SYSTEM.with(|g| { - if let Some(sys) = &*g.borrow() { - res = Some(Rc::clone(sys)); - } - }); - res - } - // TODO: find or build a proc macro for this pub fn variants() -> Vec<&'static str> { vec!["Glutin", "X11"]