From 75ac570486b9dea39e8562105be51883e837b914 Mon Sep 17 00:00:00 2001 From: Nova Date: Wed, 9 Nov 2022 13:05:21 -0500 Subject: [PATCH] refactor(wayland): s/ObjectId/Weak/ --- src/wayland/surface.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wayland/surface.rs b/src/wayland/surface.rs index 37ed773..b323dee 100644 --- a/src/wayland/surface.rs +++ b/src/wayland/surface.rs @@ -16,7 +16,7 @@ use smithay::{ desktop::utils::send_frames_surface_tree, output::Output, 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}, }; @@ -96,7 +96,7 @@ pub struct CoreSurface { display: Weak>>, pub state: Weak>, pub dh: DisplayHandle, - pub surface_id: ObjectId, + pub weak_surface: wayland_server::Weak, pub mapped_data: Mutex>, pub pending_material_applications: Mutex, u32)>>, } @@ -112,7 +112,7 @@ impl CoreSurface { display: Arc::downgrade(display), state: Arc::downgrade(state), dh, - surface_id: surface.id(), + weak_surface: surface.downgrade(), mapped_data: Mutex::new(None), pending_material_applications: Mutex::new(Vec::new()), }) @@ -199,7 +199,7 @@ impl CoreSurface { } 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(&self, f: F) -> T