clean(wayland): unnecessary variables
This commit is contained in:
@@ -2,10 +2,7 @@ use super::{
|
|||||||
positioner::{Positioner, PositionerData},
|
positioner::{Positioner, PositionerData},
|
||||||
surface::Surface,
|
surface::Surface,
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::nodes::items::panel::SurfaceId;
|
||||||
nodes::items::panel::{Geometry, SurfaceId},
|
|
||||||
wayland::util::DoubleBuffer,
|
|
||||||
};
|
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@@ -16,21 +13,12 @@ use waynest::{
|
|||||||
|
|
||||||
#[derive(Debug, Dispatcher)]
|
#[derive(Debug, Dispatcher)]
|
||||||
pub struct Popup {
|
pub struct Popup {
|
||||||
id: ObjectId,
|
|
||||||
version: u32,
|
version: u32,
|
||||||
parent: Arc<Surface>,
|
|
||||||
pub surface: Arc<Surface>,
|
pub surface: Arc<Surface>,
|
||||||
positioner_data: Mutex<PositionerData>,
|
positioner_data: Mutex<PositionerData>,
|
||||||
geometry: DoubleBuffer<Geometry>,
|
|
||||||
}
|
}
|
||||||
impl Popup {
|
impl Popup {
|
||||||
pub fn new(
|
pub fn new(version: u32, surface: Arc<Surface>, positioner: &Positioner) -> Self {
|
||||||
id: ObjectId,
|
|
||||||
version: u32,
|
|
||||||
parent: Arc<Surface>,
|
|
||||||
surface: Arc<Surface>,
|
|
||||||
positioner: &Positioner,
|
|
||||||
) -> Self {
|
|
||||||
let _ = surface
|
let _ = surface
|
||||||
.wl_surface
|
.wl_surface
|
||||||
.surface_id
|
.surface_id
|
||||||
@@ -38,12 +26,9 @@ impl Popup {
|
|||||||
|
|
||||||
let positioner_data = positioner.data();
|
let positioner_data = positioner.data();
|
||||||
Self {
|
Self {
|
||||||
id,
|
|
||||||
version,
|
version,
|
||||||
parent,
|
|
||||||
surface,
|
surface,
|
||||||
positioner_data: Mutex::new(positioner_data),
|
positioner_data: Mutex::new(positioner_data),
|
||||||
geometry: DoubleBuffer::new(positioner_data.infinite_geometry()),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,10 +156,7 @@ impl XdgSurface for Surface {
|
|||||||
|
|
||||||
let surface = client.get::<Surface>(self.id).unwrap();
|
let surface = client.get::<Surface>(self.id).unwrap();
|
||||||
|
|
||||||
let popup = client.insert(
|
let popup = client.insert(popup_id, Popup::new(self.version, surface, &positioner));
|
||||||
popup_id,
|
|
||||||
Popup::new(popup_id, self.version, parent.clone(), surface, &positioner),
|
|
||||||
);
|
|
||||||
|
|
||||||
popup.configure(client, popup_id, 0, 0, 0, 0).await?;
|
popup.configure(client, popup_id, 0, 0, 0, 0).await?;
|
||||||
let serial = client.next_event_serial();
|
let serial = client.next_event_serial();
|
||||||
|
|||||||
Reference in New Issue
Block a user