refactor(wayland): make code cleaner
This commit is contained in:
@@ -217,9 +217,9 @@ impl PanelItem {
|
||||
let cursor = self.seat_data.cursor.lock();
|
||||
if let Some(cursor) = cursor.as_ref().map(|cursor| cursor.lock()) {
|
||||
if let Some(core_surface) = cursor.core_surface.upgrade() {
|
||||
if let Some(mapped_data) = &*core_surface.mapped_data.lock() {
|
||||
core_surface.with_data(|mapped_data| {
|
||||
data = serialize((mapped_data.size, cursor.hotspot)).unwrap();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,9 +209,9 @@ impl Dispatch<WlPointer, SeatData, WaylandState> for SeatDelegate {
|
||||
hotspot_x,
|
||||
hotspot_y,
|
||||
} => {
|
||||
if !*seat_data.pointer_active.lock() {
|
||||
return;
|
||||
}
|
||||
// if !seat_data.pointer_active() {
|
||||
// return;
|
||||
// }
|
||||
*seat_data.0.cursor_changed.lock() = true;
|
||||
if let Some(surface) = surface.as_ref() {
|
||||
compositor::with_states(surface, |data| {
|
||||
|
||||
@@ -97,7 +97,7 @@ pub struct CoreSurface {
|
||||
pub state: Weak<Mutex<WaylandState>>,
|
||||
pub dh: DisplayHandle,
|
||||
pub weak_surface: wayland_server::Weak<WlSurface>,
|
||||
pub mapped_data: Mutex<Option<CoreSurfaceData>>,
|
||||
mapped_data: Mutex<Option<CoreSurfaceData>>,
|
||||
pub pending_material_applications: Mutex<Vec<(Arc<Model>, u32)>>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user