Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update remaining deps #56

Merged
merged 3 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
763 changes: 411 additions & 352 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ itertools = "0.13.0"
lagoon = { version = "0.1.3", features = ["scope"] }
nix = { version = "0.29.0", features = ["fs", "socket"] }
num_enum = "0.7.2"
optional_struct = "0.3.1"
optional_struct = "0.5.2"
rkyv = { version = "0.8.8" }
ron = "0.8.1"
serde = "1.0.203"
Expand All @@ -43,7 +43,7 @@ smithay = { git = "https://github.com/Smithay/smithay.git", default-features = f
] }
smithay-client-toolkit = { git = "https://github.com/Smithay/client-toolkit.git" }
static_assertions = "1.1.0"
sysctl = "0.5.5"
sysctl = "0.6.0"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["parking_lot"] }
tracing-tracy = { version = "0.11.0", optional = true, features = [
Expand Down
4 changes: 2 additions & 2 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering;

use bpaf::Parser;
use optional_struct::Applyable;
use optional_struct::Applicable;
use ron::extensions::Extensions;
use ron::Options;
use serde::Deserialize;
Expand All @@ -50,7 +50,7 @@ pub trait Config: Debug + Default + Serialize {
}

pub trait OptionalConfig<Conf: Config>:
Debug + Default + Applyable<Conf> + for<'a> Deserialize<'a>
Debug + Default + Applicable<Base = Conf> + for<'a> Deserialize<'a>
{
fn parse_args() -> Self;
fn print_default_config_and_exit(&self) -> Option<bool>;
Expand Down
1 change: 0 additions & 1 deletion src/bin/wprsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use std::path::PathBuf;

use bpaf::Parser;
use optional_struct::optional_struct;
use optional_struct::Applyable;
use serde_derive::Deserialize;
use serde_derive::Serialize;
use smithay::reexports::calloop::channel::Event;
Expand Down
1 change: 0 additions & 1 deletion src/bin/wprsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use std::time::Duration;

use bpaf::Parser;
use optional_struct::optional_struct;
use optional_struct::Applyable;
use serde_derive::Deserialize;
use serde_derive::Serialize;
use smithay::reexports::calloop::channel::Event;
Expand Down
1 change: 0 additions & 1 deletion src/bin/xwayland-xdg-shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use std::path::PathBuf;

use bpaf::Parser;
use optional_struct::optional_struct;
use optional_struct::Applyable;
use serde_derive::Deserialize;
use serde_derive::Serialize;
use smithay::reexports::calloop::generic::Generic;
Expand Down
17 changes: 12 additions & 5 deletions src/server/client_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl WprsServerState {
let serial = self.serial_map.insert(serial);
pointer.motion(
self,
Some((surface, (0, 0).into())),
Some((surface, (0 as f64, 0 as f64).into())),
&MotionEvent {
location: event.position.into(),
serial,
Expand Down Expand Up @@ -180,7 +180,7 @@ impl WprsServerState {
debug!("pointer moved to {:?}", event.position);
pointer.motion(
self,
Some((surface, (0, 0).into())),
Some((surface, (0 as f64, 0 as f64).into())),
&MotionEvent {
location: event.position.into(),
serial: 0.into(), // unused
Expand Down Expand Up @@ -257,7 +257,7 @@ impl WprsServerState {

keyboard.input::<(), _>(
self,
keycode,
keycode.into(),
state,
serial,
self.start_time.elapsed().as_millis() as u32,
Expand Down Expand Up @@ -723,7 +723,11 @@ impl WprsServerState {

let serial = self.serial_map.insert(drag_enter.serial);
let pointer = self.seat.get_pointer().location(loc!())?;
let grab = DndGrab::new(Some((surface, (0, 0).into())), 0, drag_enter.loc.into());
let grab = DndGrab::new(
Some((surface, (0 as f64, 0 as f64).into())),
0,
drag_enter.loc.into(),
);
pointer.set_grab(self, grab, serial, Focus::Keep);
let drag_start_data = pointer.grab_start_data();
debug!("DRAG GRAB: pointer.grab_start_data {:?}", drag_start_data);
Expand Down Expand Up @@ -767,7 +771,10 @@ impl WprsServerState {
if let Some(grab_start_data) = pointer.grab_start_data() {
pointer.motion(
self,
Some((grab_start_data.focus.location(loc!())?.0, (0, 0).into())),
Some((
grab_start_data.focus.location(loc!())?.0,
(0 as f64, 0 as f64).into(),
)),
&MotionEvent {
location: drag_motion.into(),
serial: 0.into(), // unused
Expand Down
23 changes: 14 additions & 9 deletions src/server/smithay_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ pub fn get_child_positions(surface: &WlSurface) -> Vec<SubsurfacePosition> {
position: compositor::with_states(child, |surface_data| {
surface_data
.cached_state
.pending::<SubsurfaceCachedState>()
.get::<SubsurfaceCachedState>()
.pending()
.location
.into()
}),
Expand Down Expand Up @@ -656,7 +657,9 @@ pub fn set_transformation(
#[instrument(skip_all, level = "debug")]
pub fn set_xdg_surface_attributes(surface_data: &SurfaceData, surface_state: &mut SurfaceState) {
if surface_data.cached_state.has::<SurfaceCachedState>() {
let surface_cached_state = surface_data.cached_state.current::<SurfaceCachedState>();
let mut guard = surface_data.cached_state.get::<SurfaceCachedState>();
let surface_cached_state = guard.current();

let xdg_surface_state = XdgSurfaceState {
window_geometry: surface_cached_state
.geometry
Expand Down Expand Up @@ -744,7 +747,8 @@ pub fn commit_impl(
position: (0, 0).into(),
});

let mut surface_attributes = surface_data.cached_state.current::<SurfaceAttributes>();
let mut guard = surface_data.cached_state.get::<SurfaceAttributes>();
let surface_attributes = guard.current();
let mut frame_callbacks = mem::take(&mut surface_attributes.frame_callbacks);

if !frame_callbacks.is_empty() {
Expand Down Expand Up @@ -786,8 +790,8 @@ pub fn commit_impl(
.expect("timer registration should never fail");
}

set_regions(&surface_attributes, surface_state);
set_transformation(&surface_attributes, surface_state);
set_regions(surface_attributes, surface_state);
set_transformation(surface_attributes, surface_state);
set_xdg_surface_attributes(surface_data, surface_state);

match &mut surface_state.role {
Expand All @@ -796,7 +800,8 @@ pub fn commit_impl(
subsurface_state.sync = sync;
subsurface_state.location = surface_data
.cached_state
.pending::<SubsurfaceCachedState>()
.get::<SubsurfaceCachedState>()
.pending()
.location
.into();
},
Expand Down Expand Up @@ -1037,7 +1042,7 @@ impl DndGrab {
pub fn new(
focus: Option<(
<WprsServerState as SeatHandler>::PointerFocus,
Point<i32, Logical>,
Point<f64, Logical>,
)>,
button: u32,
location: (f64, f64),
Expand All @@ -1064,7 +1069,7 @@ impl PointerGrab<WprsServerState> for DndGrab {
_handle: &mut PointerInnerHandle<'_, WprsServerState>,
focus: Option<(
<WprsServerState as SeatHandler>::PointerFocus,
Point<i32, Logical>,
Point<f64, Logical>,
)>,
event: &MotionEvent,
) {
Expand All @@ -1077,7 +1082,7 @@ impl PointerGrab<WprsServerState> for DndGrab {
_handle: &mut PointerInnerHandle<'_, WprsServerState>,
focus: Option<(
<WprsServerState as SeatHandler>::PointerFocus,
Point<i32, Logical>,
Point<f64, Logical>,
)>,
event: &RelativeMotionEvent,
) {
Expand Down
7 changes: 4 additions & 3 deletions src/xwayland_xdg_shell/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ impl CompositorHandler for WprsState {
compositor::with_states(&wl_surface, |surface_data| {
for callback in surface_data
.cached_state
.current::<SurfaceAttributes>()
.get::<SurfaceAttributes>()
.current()
.frame_callbacks
.drain(..)
{
Expand Down Expand Up @@ -844,7 +845,7 @@ impl PointerHandler for WprsState {
let serial = self.compositor_state.serial_map.insert(serial);
compositor_pointer.motion(
self,
Some((x11_surface, (0, 0).into())),
Some((x11_surface, (0 as f64, 0 as f64).into())),
&MotionEvent {
location: event.position.into(),
serial,
Expand All @@ -867,7 +868,7 @@ impl PointerHandler for WprsState {
PointerEventKind::Motion { time } => {
compositor_pointer.motion(
self,
Some((x11_surface, (0, 0).into())),
Some((x11_surface, (0 as f64, 0 as f64).into())),
&MotionEvent {
location: event.position.into(),
serial: 0.into(), // unused
Expand Down
12 changes: 7 additions & 5 deletions src/xwayland_xdg_shell/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ use smithay::wayland::shm::ShmHandler;
use smithay::wayland::shm::ShmState;
use smithay::wayland::xwayland_shell::XWaylandShellHandler;
use smithay::wayland::xwayland_shell::XWaylandShellState;
use smithay::xwayland::xwm::XwmId;
use smithay::xwayland::X11Surface;
use smithay::xwayland::X11Wm;
use smithay::xwayland::XWayland;
Expand All @@ -73,7 +74,6 @@ use smithay_client_toolkit::reexports::csd_frame::DecorationsFrame;
use smithay_client_toolkit::reexports::protocols::xdg::shell::client::xdg_surface;
use smithay_client_toolkit::shell::xdg::XdgSurface;
use smithay_client_toolkit::shell::WaylandSurface;
use x11rb::protocol::xproto::Window;

use crate::compositor_utils;
use crate::fallible_entry::FallibleEntryExt;
Expand Down Expand Up @@ -328,11 +328,11 @@ impl XWaylandShellHandler for WprsState {
&mut self.compositor_state.xwayland_shell_state
}

fn surface_associated(&mut self, surface: WlSurface, window: Window) {
fn surface_associated(&mut self, _xwm: XwmId, wl_surface: WlSurface, surface: X11Surface) {
// TODO: we should implement this and get rid of the deferring commit logic below
debug!(
"X11 window {:?} associated with surface {:?}",
window, surface
surface, wl_surface
)
}
}
Expand Down Expand Up @@ -488,7 +488,9 @@ pub fn commit_inner(
surface_data: &SurfaceData,
state: &mut WprsState,
) -> Result<()> {
let mut surface_attributes = surface_data.cached_state.current::<SurfaceAttributes>();
let mut guard = surface_data.cached_state.get::<SurfaceAttributes>();
let surface_attributes = guard.current();

let x11_surface = state
.compositor_state
.x11_surfaces
Expand Down Expand Up @@ -624,7 +626,7 @@ pub fn commit_inner(
compositor_utils::send_frames(
surface,
&surface_data.data_map,
&mut surface_attributes,
surface_attributes,
state.compositor_state.start_time.elapsed(),
Duration::ZERO,
)
Expand Down
2 changes: 1 addition & 1 deletion src/xwayland_xdg_shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ impl WprsState {

keyboard.input::<(), _>(
self,
keycode,
keycode.into(),
state,
serial,
self.compositor_state.start_time.elapsed().as_millis() as u32,
Expand Down