diff --git a/Cargo.lock b/Cargo.lock index ba9b8868..ba4fadaa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2174,16 +2174,16 @@ dependencies = [ [[package]] name = "input" -version = "0.8.3" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e74cd82cedcd66db78742a8337bdc48f188c4d2c12742cbc5cd85113f0b059" +checksum = "7911ce3db9c10c5ab4a35c49af778a5f9a827bd0f7371d9be56175d8dd2740d0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "input-sys", "io-lifetimes 1.0.11", "libc", "log", - "udev 0.7.0", + "udev", ] [[package]] @@ -4023,7 +4023,7 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smithay" version = "0.3.0" -source = "git+https://github.com/smithay//smithay?rev=f1e7fc18a#f1e7fc18a7f060f8ff1e647ca407df62f85467cf" +source = "git+https://github.com/smithay//smithay?rev=3b3e07952e#3b3e07952e471618fe8b590ba3223f4201cec10c" dependencies = [ "appendlist", "ash", @@ -4058,7 +4058,7 @@ dependencies = [ "tempfile", "thiserror", "tracing", - "udev 0.8.0", + "udev", "wayland-backend", "wayland-egl", "wayland-protocols", @@ -4597,17 +4597,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "udev" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebdbbd670373442a12fe9ef7aeb53aec4147a5a27a00bbc3ab639f08f48191a" -dependencies = [ - "libc", - "libudev-sys", - "pkg-config", -] - [[package]] name = "udev" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index 55ddb241..b1326870 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,4 +91,4 @@ debug = true lto = "fat" [patch."https://github.com/Smithay/smithay.git"] -smithay = { git = "https://github.com/smithay//smithay", rev = "f1e7fc18a" } +smithay = { git = "https://github.com/smithay//smithay", rev = "3b3e07952e" } diff --git a/cosmic-comp-config/Cargo.toml b/cosmic-comp-config/Cargo.toml index 4d281232..835adc86 100644 --- a/cosmic-comp-config/Cargo.toml +++ b/cosmic-comp-config/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] cosmic-config = { git = "https://github.com/pop-os/libcosmic/" } -input = "0.8.3" +input = "0.9.0" serde = { version = "1", features = ["derive"] } diff --git a/src/backend/kms/mod.rs b/src/backend/kms/mod.rs index 9942e499..40d1f673 100644 --- a/src/backend/kms/mod.rs +++ b/src/backend/kms/mod.rs @@ -35,7 +35,7 @@ use smithay::{ buffer_dimensions, damage::{Error as RenderError, RenderOutputResult}, element::Element, - gles::{GlesRenderbuffer, GlesTexture}, + gles::GlesRenderbuffer, glow::GlowRenderer, multigpu::{gbm::GbmGlesBackend, Error as MultiError, GpuManager}, sync::SyncPoint, @@ -79,7 +79,6 @@ use tracing::{error, info, trace, warn}; use std::{ cell::RefCell, collections::{HashMap, HashSet}, - ffi::CStr, fmt, path::PathBuf, time::Duration, @@ -278,7 +277,10 @@ pub fn init_backend( error!(?err, "Failed to resume libinput context."); } for device in state.backend.kms().devices.values_mut() { - device.drm.activate(); + if let Err(err) = device.drm.activate(true) { + error!(?err, "Failed to resume drm device"); + } + // TODO save state, do the disable part manually, etc if let Some(lease_state) = device.leasing_global.as_mut() { lease_state.resume::(); } @@ -421,7 +423,7 @@ impl State { let gbm = GbmDevice::new(fd) .with_context(|| format!("Failed to initialize GBM device for {}", path.display()))?; let (render_node, formats) = { - let egl_display = EGLDisplay::new(gbm.clone()).with_context(|| { + let egl_display = unsafe { EGLDisplay::new(gbm.clone()) }.with_context(|| { format!("Failed to create EGLDisplay for device: {}", path.display()) })?; let egl_device = EGLDevice::device_for_display(&egl_display).with_context(|| { @@ -1175,7 +1177,7 @@ impl Surface { })?; self.fps.elements(); - let res = compositor.render_frame::<_, _, GlesTexture>( + let res = compositor.render_frame( &mut renderer, &elements, CLEAR_COLOR, // TODO use a theme neutral color @@ -1184,7 +1186,7 @@ impl Surface { match res { Ok(frame_result) => { - let feedback = if frame_result.damage.is_some() { + let feedback = if !frame_result.is_empty { Some(state.take_presentation_feedback(&self.output, &frame_result.states)) } else { None diff --git a/src/backend/x11.rs b/src/backend/x11.rs index 853b5a8d..4fb2f4e7 100644 --- a/src/backend/x11.rs +++ b/src/backend/x11.rs @@ -349,7 +349,7 @@ pub fn init_backend( .find(|device| device.try_get_render_node().ok().flatten() == Some(drm_node)) .with_context(|| format!("Failed to find EGLDevice for node {}", drm_node))?; // Initialize EGL - let egl = EGLDisplay::new(device).with_context(|| "Failed to create EGL display")?; + let egl = unsafe { EGLDisplay::new(device) }.with_context(|| "Failed to create EGL display")?; // Create the OpenGL context let context = EGLContext::new(&egl).with_context(|| "Failed to create EGL context")?; // Create a renderer @@ -470,6 +470,7 @@ pub fn init_backend( } } X11Event::Input(event) => state.process_x11_event(event), + X11Event::Focus(_) => {} // TODO: release all keys when losing focus and make sure to go through our keyboard filter code }) .map_err(|_| anyhow::anyhow!("Failed to insert X11 Backend into event loop"))?; diff --git a/src/input/mod.rs b/src/input/mod.rs index ca10a4ed..2ba9d180 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1362,6 +1362,7 @@ impl State { } } InputEvent::Special(_) => {} + InputEvent::SwitchToggle { event: _ } => {} } } diff --git a/src/wayland/handlers/output.rs b/src/wayland/handlers/output.rs index f631ba10..f771ed41 100644 --- a/src/wayland/handlers/output.rs +++ b/src/wayland/handlers/output.rs @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-only use crate::state::State; -use smithay::delegate_output; +use smithay::{delegate_output, wayland::output::OutputHandler}; + +impl OutputHandler for State {} delegate_output!(State);