From 21e31547eacd3a137b4e4e305723d29daa10efe2 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Sun, 14 Mar 2021 17:24:30 -0400 Subject: [PATCH] Don't use headless winit event loop on macOS. --- ports/winit/events_loop.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/winit/events_loop.rs b/ports/winit/events_loop.rs index 3bd82574b31..2d76fe41c37 100644 --- a/ports/winit/events_loop.rs +++ b/ports/winit/events_loop.rs @@ -29,11 +29,11 @@ pub struct EventsLoop(EventLoop); impl EventsLoop { // Ideally, we could use the winit event loop in both modes, // but on Linux, the event loop requires a X11 server. - #[cfg(not(target_os = "linux"))] + #[cfg(not(any(target_os = "linux", target_os = "macos")))] pub fn new(_headless: bool) -> EventsLoop { EventsLoop(EventLoop::Winit(Some(winit::event_loop::EventLoop::with_user_event()))) } - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "macos"))] pub fn new(headless: bool) -> EventsLoop { EventsLoop(if headless { EventLoop::Headless(Arc::new((Mutex::new(false), Condvar::new())))