mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Don't use headless winit event loop on macOS.
This commit is contained in:
parent
490c215798
commit
21e31547ea
1 changed files with 2 additions and 2 deletions
|
@ -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())))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue