fix(wayland): strip out all the xwayland stuff finally

This commit is contained in:
Nova
2024-06-13 13:34:42 -04:00
parent f73c8f968d
commit 36fd3216c7
6 changed files with 57 additions and 50 deletions

View File

@@ -152,7 +152,6 @@ impl Wayland {
pid: stream.peer_cred().ok().and_then(|c| c.pid()),
id: OnceCell::new(),
compositor_state: Default::default(),
display: Arc::downgrade(&display),
seat: state.lock().seat.clone(),
});
let _client = dh2.insert_client(stream.into_std()?, client_state.clone())?;

View File

@@ -39,7 +39,7 @@ impl SeatHandler for WaylandState {
self.seat.cursor_info_tx.send_modify(|c| match image {
CursorImageStatus::Hidden => c.surface = None,
CursorImageStatus::Surface(surface) => {
CoreSurface::add_to(self.display_handle.clone(), &surface, || (), |_| ());
CoreSurface::add_to(&surface, || (), |_| ());
compositor::with_states(&surface, |data| {
if let Some(core_surface) = data.data_map.get::<Arc<CoreSurface>>() {
core_surface.set_material_offset(1);

View File

@@ -1,4 +1,4 @@
use super::{seat::SeatWrapper, DisplayWrapper};
use super::seat::SeatWrapper;
use crate::wayland::drm::wl_drm::WlDrm;
use once_cell::sync::OnceCell;
use parking_lot::Mutex;
@@ -41,7 +41,7 @@ use smithay::{
shm::{ShmHandler, ShmState},
},
};
use std::sync::{Arc, Weak};
use std::sync::Arc;
use tokio::sync::mpsc::UnboundedSender;
use tracing::{info, warn};
@@ -49,7 +49,6 @@ pub struct ClientState {
pub pid: Option<i32>,
pub id: OnceCell<ClientId>,
pub compositor_state: CompositorClientState,
pub display: Weak<DisplayWrapper>,
pub seat: Arc<SeatWrapper>,
}
impl ClientData for ClientState {
@@ -67,9 +66,6 @@ impl ClientData for ClientState {
}
pub struct WaylandState {
pub weak_ref: Weak<Mutex<WaylandState>>,
pub display_handle: DisplayHandle,
pub compositor_state: CompositorState,
// pub xdg_activation_state: XdgActivationState,
pub kde_decoration_state: KdeDecorationState,
@@ -176,9 +172,6 @@ impl WaylandState {
Arc::new_cyclic(|weak| {
Mutex::new(WaylandState {
weak_ref: weak.clone(),
display_handle,
compositor_state,
// xdg_activation_state,
kde_decoration_state,

View File

@@ -21,7 +21,7 @@ use smithay::{
},
desktop::utils::send_frames_surface_tree,
output::Output,
reexports::wayland_server::{self, protocol::wl_surface::WlSurface, DisplayHandle, Resource},
reexports::wayland_server::{self, protocol::wl_surface::WlSurface, Resource},
wayland::compositor::{self, SurfaceData},
};
use std::{cell::RefCell, ffi::c_void, sync::Arc, time::Duration};
@@ -45,7 +45,6 @@ impl Drop for CoreSurfaceData {
}
pub struct CoreSurface {
pub dh: DisplayHandle,
pub weak_surface: wayland_server::Weak<WlSurface>,
mapped_data: Mutex<Option<CoreSurfaceData>>,
sk_tex: OnceCell<Mutex<TexWrapper>>,
@@ -58,13 +57,11 @@ pub struct CoreSurface {
impl CoreSurface {
pub fn add_to(
dh: DisplayHandle,
surface: &WlSurface,
on_mapped: impl Fn() + Send + Sync + 'static,
on_commit: impl Fn(u32) + Send + Sync + 'static,
) {
let core_surface = CORE_SURFACES.add(CoreSurface {
dh,
weak_surface: surface.downgrade(),
mapped_data: Mutex::new(None),
sk_tex: OnceCell::new(),

View File

@@ -88,7 +88,6 @@ impl XdgShellHandler for WaylandState {
toplevel.send_configure();
utils::insert_data(toplevel.wl_surface(), SurfaceId::Toplevel);
CoreSurface::add_to(
self.display_handle.clone(),
toplevel.wl_surface(),
{
let toplevel = toplevel.clone();
@@ -199,7 +198,6 @@ impl XdgShellHandler for WaylandState {
utils::insert_data(popup.wl_surface(), uid);
utils::insert_data(popup.wl_surface(), Arc::downgrade(&panel_item));
CoreSurface::add_to(
self.display_handle.clone(),
popup.wl_surface(),
{
let popup = popup.clone();