refactor(wayland): s/ObjectId/Weak<WlSurface>/
This commit is contained in:
@@ -16,7 +16,7 @@ use smithay::{
|
|||||||
desktop::utils::send_frames_surface_tree,
|
desktop::utils::send_frames_surface_tree,
|
||||||
output::Output,
|
output::Output,
|
||||||
reexports::wayland_server::{
|
reexports::wayland_server::{
|
||||||
backend::ObjectId, protocol::wl_surface::WlSurface, Display, DisplayHandle, Resource,
|
self, protocol::wl_surface::WlSurface, Display, DisplayHandle, Resource,
|
||||||
},
|
},
|
||||||
wayland::compositor::{self, SurfaceData, SurfaceUserData},
|
wayland::compositor::{self, SurfaceData, SurfaceUserData},
|
||||||
};
|
};
|
||||||
@@ -96,7 +96,7 @@ pub struct CoreSurface {
|
|||||||
display: Weak<Mutex<Display<WaylandState>>>,
|
display: Weak<Mutex<Display<WaylandState>>>,
|
||||||
pub state: Weak<Mutex<WaylandState>>,
|
pub state: Weak<Mutex<WaylandState>>,
|
||||||
pub dh: DisplayHandle,
|
pub dh: DisplayHandle,
|
||||||
pub surface_id: ObjectId,
|
pub weak_surface: wayland_server::Weak<WlSurface>,
|
||||||
pub mapped_data: Mutex<Option<CoreSurfaceData>>,
|
pub mapped_data: Mutex<Option<CoreSurfaceData>>,
|
||||||
pub pending_material_applications: Mutex<Vec<(Arc<Model>, u32)>>,
|
pub pending_material_applications: Mutex<Vec<(Arc<Model>, u32)>>,
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ impl CoreSurface {
|
|||||||
display: Arc::downgrade(display),
|
display: Arc::downgrade(display),
|
||||||
state: Arc::downgrade(state),
|
state: Arc::downgrade(state),
|
||||||
dh,
|
dh,
|
||||||
surface_id: surface.id(),
|
weak_surface: surface.downgrade(),
|
||||||
mapped_data: Mutex::new(None),
|
mapped_data: Mutex::new(None),
|
||||||
pending_material_applications: Mutex::new(Vec::new()),
|
pending_material_applications: Mutex::new(Vec::new()),
|
||||||
})
|
})
|
||||||
@@ -199,7 +199,7 @@ impl CoreSurface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn wl_surface(&self) -> WlSurface {
|
pub fn wl_surface(&self) -> WlSurface {
|
||||||
WlSurface::from_id(&self.dh, self.surface_id.clone()).unwrap()
|
self.weak_surface.upgrade().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_states<F, T>(&self, f: F) -> T
|
pub fn with_states<F, T>(&self, f: F) -> T
|
||||||
|
|||||||
Reference in New Issue
Block a user