Skip to content

Commit

Permalink
Merge pull request #156 from pop-os/pointer-gestures_jammy
Browse files Browse the repository at this point in the history
Update smithay, add pointer gestures and security context
  • Loading branch information
Drakulix authored Sep 5, 2023
2 parents 1392fc7 + 8dce518 commit 5fb2fea
Show file tree
Hide file tree
Showing 21 changed files with 1,605 additions and 427 deletions.
31 changes: 7 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ debug = true
lto = "fat"

[patch."https://github.com/Smithay/smithay.git"]
smithay = { git = "https://github.com/smithay//smithay", rev = "02ccc8ca17" }
smithay = { git = "https://github.com/smithay//smithay", rev = "36a0ec69b1" }
23 changes: 13 additions & 10 deletions src/backend/kms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,11 @@ impl State {
surface
.output
.current_mode()
.map(|mode| mode.refresh as u32)
.map(|mode| {
Duration::from_secs_f64(
1_000.0 / mode.refresh as f64,
)
})
.unwrap_or_default(),
seq as u64,
flags,
Expand Down Expand Up @@ -1002,19 +1006,20 @@ fn get_surface_dmabuf_feedback(
.collect::<HashSet<_>>();

let surface = compositor.surface();
let planes = surface.planes().unwrap();
let planes = surface.planes();
// We limit the scan-out trache to formats we can also render from
// so that there is always a fallback render path available in case
// the supplied buffer can not be scanned out directly
let planes_formats = surface
.supported_formats(planes.primary.handle)
.unwrap()
.into_iter()
let planes_formats = planes
.primary
.formats
.iter()
.cloned()
.chain(
planes
.overlay
.iter()
.flat_map(|p| surface.supported_formats(p.handle).unwrap()),
.flat_map(|p| p.formats.iter().cloned()),
)
.collect::<HashSet<_>>()
.intersection(&combined_formats)
Expand Down Expand Up @@ -1330,9 +1335,7 @@ impl KmsState {
let driver = drm
.get_driver()
.with_context(|| "Failed to query drm driver")?;
let mut planes = drm_surface
.planes()
.with_context(|| "Failed to query drm planes")?;
let mut planes = drm_surface.planes().clone();
// QUIRK: Using an overlay plane on a nvidia card breaks the display controller (wtf...)
if driver
.name()
Expand Down
4 changes: 2 additions & 2 deletions src/backend/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use smithay::{
utils::Transform,
wayland::dmabuf::DmabufFeedbackBuilder,
};
use std::cell::RefCell;
use std::{cell::RefCell, time::Duration};
use tracing::{error, info, warn};

#[cfg(feature = "debug")]
Expand Down Expand Up @@ -94,7 +94,7 @@ impl WinitState {
state.clock.now(),
self.output
.current_mode()
.map(|mode| mode.refresh as u32)
.map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64))
.unwrap_or_default(),
0,
wp_presentation_feedback::Kind::Vsync,
Expand Down
4 changes: 2 additions & 2 deletions src/backend/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use smithay::{
utils::{DeviceFd, Transform},
wayland::dmabuf::DmabufFeedbackBuilder,
};
use std::{cell::RefCell, os::unix::io::OwnedFd};
use std::{cell::RefCell, os::unix::io::OwnedFd, time::Duration};
use tracing::{debug, error, info, warn};

#[cfg(feature = "debug")]
Expand Down Expand Up @@ -260,7 +260,7 @@ impl Surface {
state.clock.now(),
self.output
.current_mode()
.map(|mode| mode.refresh as u32)
.map(|mode| Duration::from_secs_f64(1_000.0 / mode.refresh as f64))
.unwrap_or_default(),
0,
wp_presentation_feedback::Kind::Vsync,
Expand Down
Loading

0 comments on commit 5fb2fea

Please sign in to comment.