Skip to content

Commit

Permalink
refactor(wayland): use smithay seats
Browse files Browse the repository at this point in the history
  • Loading branch information
technobaboo committed Mar 8, 2024
1 parent 807928a commit fba4e10
Show file tree
Hide file tree
Showing 9 changed files with 907 additions and 656 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions src/nodes/items/panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ pub struct PanelItemInitData {

pub trait Backend: Send + Sync + 'static {
fn start_data(&self) -> Result<PanelItemInitData>;
fn surface_alive(&self, surface: &SurfaceID) -> bool;

fn apply_surface_material(&self, surface: SurfaceID, model_part: &Arc<ModelPart>);

Expand Down Expand Up @@ -542,6 +543,9 @@ impl<B: Backend + ?Sized> Backend for PanelItem<B> {
fn start_data(&self) -> Result<PanelItemInitData> {
self.backend.start_data()
}
fn surface_alive(&self, surface: &SurfaceID) -> bool {
self.backend.surface_alive(surface)
}

fn apply_surface_material(&self, surface: SurfaceID, model_part: &Arc<ModelPart>) {
self.backend.apply_surface_material(surface, model_part)
Expand Down
6 changes: 2 additions & 4 deletions src/wayland/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub mod xwayland_rootless;
use self::xwayland_rootless::XWaylandState;

use self::{state::WaylandState, surface::CORE_SURFACES};
use crate::wayland::seat::SeatData;
use crate::{core::task, wayland::state::ClientState};
use color_eyre::eyre::{ensure, Result};
use global_counter::primitive::exact::CounterU32;
Expand Down Expand Up @@ -179,10 +178,9 @@ impl Wayland {
id: OnceCell::new(),
compositor_state: Default::default(),
display: Arc::downgrade(&display),
seat: SeatData::new(&dh1)
seat: state.lock().seat.clone(),
});
let client = dh2.insert_client(stream.into_std()?, client_state.clone())?;
let _ = client_state.seat.client.set(client.id());
let _client = dh2.insert_client(stream.into_std()?, client_state.clone())?;
}
e = dispatch_poll_listener.readable() => { // Dispatch
let mut guard = e?;
Expand Down
Loading

0 comments on commit fba4e10

Please sign in to comment.