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

86
Cargo.lock generated
View File

@@ -97,9 +97,9 @@ dependencies = [
[[package]] [[package]]
name = "anstyle-query" name = "anstyle-query"
version = "1.0.3" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
dependencies = [ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
@@ -309,9 +309,9 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.98" version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695"
[[package]] [[package]]
name = "cesu8" name = "cesu8"
@@ -377,9 +377,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.7.0" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
[[package]] [[package]]
name = "cluFlock" name = "cluFlock"
@@ -891,9 +891,9 @@ dependencies = [
[[package]] [[package]]
name = "httparse" name = "httparse"
version = "1.8.0" version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545"
[[package]] [[package]]
name = "httpdate" name = "httpdate"
@@ -909,9 +909,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.14.28" version = "0.14.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@@ -1371,7 +1371,7 @@ version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn 1.0.109",
@@ -1383,7 +1383,7 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.66", "syn 2.0.66",
@@ -1571,6 +1571,15 @@ dependencies = [
"toml_edit 0.19.15", "toml_edit 0.19.15",
] ]
[[package]]
name = "proc-macro-crate"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
dependencies = [
"toml_edit 0.21.1",
]
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.85" version = "1.0.85"
@@ -1731,14 +1740,14 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.10.4" version = "1.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
"regex-automata 0.4.6", "regex-automata 0.4.7",
"regex-syntax 0.8.3", "regex-syntax 0.8.4",
] ]
[[package]] [[package]]
@@ -1752,13 +1761,13 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.4.6" version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
"regex-syntax 0.8.3", "regex-syntax 0.8.4",
] ]
[[package]] [[package]]
@@ -1769,9 +1778,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.8.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
@@ -1954,7 +1963,7 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]] [[package]]
name = "smithay" name = "smithay"
version = "0.3.0" version = "0.3.0"
source = "git+https://github.com/smithay/smithay.git#f4327306f9f3a32468d3a1b306d182c0915abd9b" source = "git+https://github.com/smithay/smithay.git#6169b213fb663d85d2e139d3bbe44dfae1ec9328"
dependencies = [ dependencies = [
"appendlist", "appendlist",
"bitflags 2.5.0", "bitflags 2.5.0",
@@ -2282,6 +2291,17 @@ dependencies = [
"winnow 0.5.40", "winnow 0.5.40",
] ]
[[package]]
name = "toml_edit"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
dependencies = [
"indexmap 2.2.6",
"toml_datetime",
"winnow 0.5.40",
]
[[package]] [[package]]
name = "toml_edit" name = "toml_edit"
version = "0.22.14" version = "0.22.14"
@@ -2292,7 +2312,7 @@ dependencies = [
"serde", "serde",
"serde_spanned", "serde_spanned",
"toml_datetime", "toml_datetime",
"winnow 0.6.9", "winnow 0.6.13",
] ]
[[package]] [[package]]
@@ -2466,15 +2486,15 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
version = "0.1.12" version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
[[package]] [[package]]
name = "utf8parse" name = "utf8parse"
version = "0.2.1" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "valuable" name = "valuable"
@@ -2654,9 +2674,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-result" name = "windows-result"
version = "0.1.1" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
dependencies = [ dependencies = [
"windows-targets 0.52.5", "windows-targets 0.52.5",
] ]
@@ -2877,9 +2897,9 @@ dependencies = [
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.6.9" version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -2897,9 +2917,9 @@ dependencies = [
[[package]] [[package]]
name = "xkeysym" name = "xkeysym"
version = "0.2.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56"
[[package]] [[package]]
name = "xml-rs" name = "xml-rs"

View File

@@ -152,7 +152,6 @@ impl Wayland {
pid: stream.peer_cred().ok().and_then(|c| c.pid()), pid: stream.peer_cred().ok().and_then(|c| c.pid()),
id: OnceCell::new(), id: OnceCell::new(),
compositor_state: Default::default(), compositor_state: Default::default(),
display: Arc::downgrade(&display),
seat: state.lock().seat.clone(), seat: state.lock().seat.clone(),
}); });
let _client = dh2.insert_client(stream.into_std()?, client_state.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 { self.seat.cursor_info_tx.send_modify(|c| match image {
CursorImageStatus::Hidden => c.surface = None, CursorImageStatus::Hidden => c.surface = None,
CursorImageStatus::Surface(surface) => { CursorImageStatus::Surface(surface) => {
CoreSurface::add_to(self.display_handle.clone(), &surface, || (), |_| ()); CoreSurface::add_to(&surface, || (), |_| ());
compositor::with_states(&surface, |data| { compositor::with_states(&surface, |data| {
if let Some(core_surface) = data.data_map.get::<Arc<CoreSurface>>() { if let Some(core_surface) = data.data_map.get::<Arc<CoreSurface>>() {
core_surface.set_material_offset(1); 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 crate::wayland::drm::wl_drm::WlDrm;
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;
use parking_lot::Mutex; use parking_lot::Mutex;
@@ -41,7 +41,7 @@ use smithay::{
shm::{ShmHandler, ShmState}, shm::{ShmHandler, ShmState},
}, },
}; };
use std::sync::{Arc, Weak}; use std::sync::Arc;
use tokio::sync::mpsc::UnboundedSender; use tokio::sync::mpsc::UnboundedSender;
use tracing::{info, warn}; use tracing::{info, warn};
@@ -49,7 +49,6 @@ pub struct ClientState {
pub pid: Option<i32>, pub pid: Option<i32>,
pub id: OnceCell<ClientId>, pub id: OnceCell<ClientId>,
pub compositor_state: CompositorClientState, pub compositor_state: CompositorClientState,
pub display: Weak<DisplayWrapper>,
pub seat: Arc<SeatWrapper>, pub seat: Arc<SeatWrapper>,
} }
impl ClientData for ClientState { impl ClientData for ClientState {
@@ -67,9 +66,6 @@ impl ClientData for ClientState {
} }
pub struct WaylandState { pub struct WaylandState {
pub weak_ref: Weak<Mutex<WaylandState>>,
pub display_handle: DisplayHandle,
pub compositor_state: CompositorState, pub compositor_state: CompositorState,
// pub xdg_activation_state: XdgActivationState, // pub xdg_activation_state: XdgActivationState,
pub kde_decoration_state: KdeDecorationState, pub kde_decoration_state: KdeDecorationState,
@@ -176,9 +172,6 @@ impl WaylandState {
Arc::new_cyclic(|weak| { Arc::new_cyclic(|weak| {
Mutex::new(WaylandState { Mutex::new(WaylandState {
weak_ref: weak.clone(),
display_handle,
compositor_state, compositor_state,
// xdg_activation_state, // xdg_activation_state,
kde_decoration_state, kde_decoration_state,

View File

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

View File

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