From da69b5130a2becd54b71e6c5c2d1a6897649bb1c Mon Sep 17 00:00:00 2001 From: Ottatop Date: Mon, 2 Oct 2023 15:19:13 -0500 Subject: [PATCH] Use high precision event loop --- src/backend/udev.rs | 6 +++--- src/backend/winit.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/udev.rs b/src/backend/udev.rs index 79e240a..68f8a58 100644 --- a/src/backend/udev.rs +++ b/src/backend/udev.rs @@ -159,7 +159,7 @@ impl BackendData for Udev { } pub fn run_udev() -> anyhow::Result<()> { - let mut event_loop = EventLoop::try_new().unwrap(); + let mut event_loop = EventLoop::try_new_high_precision().unwrap(); let mut display = Display::new().unwrap(); // Initialize session @@ -377,7 +377,7 @@ pub fn run_udev() -> anyhow::Result<()> { ); match renderer.bind_wl_display(&display.handle()) { Ok(_) => tracing::info!("EGL hardware-acceleration enabled"), - Err(err) => tracing::info!(?err, "Failed to initialize EGL hardware-acceleration"), + Err(err) => tracing::error!(?err, "Failed to initialize EGL hardware-acceleration"), } } @@ -385,7 +385,7 @@ pub fn run_udev() -> anyhow::Result<()> { let dmabuf_formats = renderer.dmabuf_formats().collect::>(); let default_feedback = DmabufFeedbackBuilder::new(primary_gpu.dev_id(), dmabuf_formats) .build() - .unwrap(); + .expect("failed to create dmabuf feedback"); let mut dmabuf_state = DmabufState::new(); let global = dmabuf_state .create_global_with_default_feedback::(&display.handle(), &default_feedback); diff --git a/src/backend/winit.rs b/src/backend/winit.rs index 3d5e3b8..cb65710 100644 --- a/src/backend/winit.rs +++ b/src/backend/winit.rs @@ -62,7 +62,7 @@ impl BackendData for Winit { /// Start Pinnacle as a window in a graphical environment. pub fn run_winit() -> anyhow::Result<()> { - let mut event_loop: EventLoop = EventLoop::try_new()?; + let mut event_loop: EventLoop = EventLoop::try_new_high_precision()?; let mut display: Display = Display::new()?; let display_handle = display.handle();