From 0650956ab4933dad1d19ed416fbbeaefde883ea5 Mon Sep 17 00:00:00 2001 From: Nova Date: Tue, 9 Sep 2025 18:49:55 -0700 Subject: [PATCH] clean(wayland): unnecessary variables --- src/wayland/xdg/popup.rs | 19 ++----------------- src/wayland/xdg/surface.rs | 5 +---- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/wayland/xdg/popup.rs b/src/wayland/xdg/popup.rs index 9f0b569..268aaaa 100644 --- a/src/wayland/xdg/popup.rs +++ b/src/wayland/xdg/popup.rs @@ -2,10 +2,7 @@ use super::{ positioner::{Positioner, PositionerData}, surface::Surface, }; -use crate::{ - nodes::items::panel::{Geometry, SurfaceId}, - wayland::util::DoubleBuffer, -}; +use crate::nodes::items::panel::SurfaceId; use parking_lot::Mutex; use rand::Rng; use std::sync::Arc; @@ -16,21 +13,12 @@ use waynest::{ #[derive(Debug, Dispatcher)] pub struct Popup { - id: ObjectId, version: u32, - parent: Arc, pub surface: Arc, positioner_data: Mutex, - geometry: DoubleBuffer, } impl Popup { - pub fn new( - id: ObjectId, - version: u32, - parent: Arc, - surface: Arc, - positioner: &Positioner, - ) -> Self { + pub fn new(version: u32, surface: Arc, positioner: &Positioner) -> Self { let _ = surface .wl_surface .surface_id @@ -38,12 +26,9 @@ impl Popup { let positioner_data = positioner.data(); Self { - id, version, - parent, surface, positioner_data: Mutex::new(positioner_data), - geometry: DoubleBuffer::new(positioner_data.infinite_geometry()), } } } diff --git a/src/wayland/xdg/surface.rs b/src/wayland/xdg/surface.rs index 6345b18..94665da 100644 --- a/src/wayland/xdg/surface.rs +++ b/src/wayland/xdg/surface.rs @@ -156,10 +156,7 @@ impl XdgSurface for Surface { let surface = client.get::(self.id).unwrap(); - let popup = client.insert( - popup_id, - Popup::new(popup_id, self.version, parent.clone(), surface, &positioner), - ); + let popup = client.insert(popup_id, Popup::new(self.version, surface, &positioner)); popup.configure(client, popup_id, 0, 0, 0, 0).await?; let serial = client.next_event_serial();