diff --git a/Cargo.lock b/Cargo.lock index 2d836845..8bebdb64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1083,7 +1083,7 @@ version = "0.19.0" source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109" dependencies = [ "bitflags 2.4.2", - "libloading 0.7.4", + "libloading 0.8.1", "winapi", ] @@ -1234,7 +1234,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.7.4", + "libloading 0.8.1", ] [[package]] @@ -2199,7 +2199,7 @@ dependencies = [ "bitflags 2.4.2", "com", "libc", - "libloading 0.7.4", + "libloading 0.8.1", "thiserror", "widestring", "winapi", @@ -3443,7 +3443,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.48", @@ -3893,15 +3893,6 @@ dependencies = [ "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.0", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -3966,9 +3957,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] @@ -4556,7 +4547,7 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smithay" version = "0.3.0" -source = "git+https://github.com/smithay//smithay?rev=64356be#64356be949f2ad5f70f601cd10255eafed2ce2ce" +source = "git+https://github.com/ids1024/smithay?branch=wl_fixes#357758ac72ab482edcb02a9b42d0411f8180b08a" dependencies = [ "appendlist", "ash", @@ -5533,13 +5524,12 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" +version = "0.3.3" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "cc", "downcast-rs", - "nix 0.26.4", + "rustix 0.38.32", "scoped-tls", "smallvec", "wayland-sys", @@ -5547,12 +5537,11 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" +version = "0.31.2" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "bitflags 2.4.2", - "nix 0.26.4", + "rustix 0.38.32", "wayland-backend", "wayland-scanner", ] @@ -5570,11 +5559,11 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44aa20ae986659d6c77d64d808a046996a932aa763913864dc40c359ef7ad5b" +checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ - "nix 0.26.4", + "rustix 0.38.32", "wayland-client", "xcursor", ] @@ -5582,8 +5571,7 @@ dependencies = [ [[package]] name = "wayland-egl" version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f652e5a24ae02d2ad536c8fc2d3dcc6c2bd635027cd6103a193e7d75eeda2" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "wayland-backend", "wayland-sys", @@ -5592,8 +5580,7 @@ dependencies = [ [[package]] name = "wayland-protocols" version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "bitflags 2.4.2", "wayland-backend", @@ -5605,8 +5592,7 @@ dependencies = [ [[package]] name = "wayland-protocols-misc" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5933740b200188c9b4c38601b8212e8c154d7de0d2cb171944e137a77de1e" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "bitflags 2.4.2", "wayland-backend", @@ -5631,8 +5617,7 @@ dependencies = [ [[package]] name = "wayland-protocols-wlr" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "bitflags 2.4.2", "wayland-backend", @@ -5644,9 +5629,8 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" +version = "0.31.1" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "proc-macro2", "quick-xml", @@ -5655,14 +5639,13 @@ dependencies = [ [[package]] name = "wayland-server" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f3f0c52a445936ca1184c98f1a69cf4ad9c9130788884531ef04428468cb1ce" +version = "0.31.1" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "bitflags 2.4.2", "downcast-rs", "io-lifetimes 2.0.3", - "nix 0.26.4", + "rustix 0.38.32", "wayland-backend", "wayland-scanner", ] @@ -5670,8 +5653,7 @@ dependencies = [ [[package]] name = "wayland-sys" version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +source = "git+https://github.com/ids1024/wayland-rs?branch=wl-fixes#3168907e21f5917602369b894230c0ac68f0e70c" dependencies = [ "dlib", "log", @@ -5777,7 +5759,7 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.7.4", + "libloading 0.8.1", "log", "metal", "naga", @@ -6320,7 +6302,7 @@ version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4a1ba45ed0ad344b85a2bb5a1fe9830aed23d67812ea39a586e7d0136439c7d" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "regex", @@ -6394,7 +6376,7 @@ version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", diff --git a/Cargo.toml b/Cargo.toml index 17180f49..1069bcbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,4 +118,16 @@ inherits = "release" lto = "fat" [patch."https://github.com/Smithay/smithay.git"] -smithay = {git = "https://github.com/smithay//smithay", rev = "64356be"} +# smithay = {git = "https://github.com/smithay//smithay", rev = "f7638e8"} +smithay = {git = "https://github.com/ids1024/smithay", branch = "wl_fixes"} + +[patch.crates-io] +wayland-egl = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-protocols = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-protocols-wlr = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-protocols-misc = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-server = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-client = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-sys = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-backend = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } +wayland-scanner = { git = "https://github.com/ids1024/wayland-rs", branch = "wl-fixes" } diff --git a/src/state.rs b/src/state.rs index 42ab4c11..54e87f2b 100644 --- a/src/state.rs +++ b/src/state.rs @@ -65,6 +65,7 @@ use smithay::{ wayland::{ compositor::{CompositorClientState, CompositorState}, dmabuf::{DmabufFeedback, DmabufGlobal, DmabufState}, + fixes::FixesState, fractional_scale::{with_fractional_scale, FractionalScaleManagerState}, idle_inhibit::IdleInhibitManagerState, idle_notify::IdleNotifierState, @@ -93,6 +94,7 @@ use smithay::{ virtual_keyboard::VirtualKeyboardManagerState, xdg_activation::XdgActivationState, xwayland_keyboard_grab::XWaylandKeyboardGrabState, + xwayland_shell::XWaylandShellState, }, xwayland::XWaylandClientData, }; @@ -219,6 +221,7 @@ pub struct Common { pub xdg_activation_state: XdgActivationState, pub workspace_state: WorkspaceState, pub xwayland_state: Option, + pub xwayland_shell_state: XWaylandShellState, } #[derive(Debug)] @@ -427,6 +430,7 @@ impl State { let session_lock_manager_state = SessionLockManagerState::new::(&dh, client_is_privileged); XWaylandKeyboardGrabState::new::(&dh); + let xwayland_shell_state = XWaylandShellState::new::(&dh); PointerConstraintsState::new::(&dh); PointerGesturesState::new::(&dh); TabletManagerState::new::(&dh); @@ -434,6 +438,7 @@ impl State { InputMethodManagerState::new::(&dh, client_is_privileged); TextInputManagerState::new::(&dh); VirtualKeyboardManagerState::new::(&dh, client_is_privileged); + FixesState::new::(&dh); let idle_notifier_state = IdleNotifierState::::new(&dh, handle.clone()); let idle_inhibit_manager_state = IdleInhibitManagerState::new::(&dh); @@ -533,6 +538,7 @@ impl State { xdg_activation_state, workspace_state, xwayland_state: None, + xwayland_shell_state, }, backend: BackendData::Unset, ready: Once::new(), diff --git a/src/wayland/handlers/compositor.rs b/src/wayland/handlers/compositor.rs index f588dec8..8956fdc7 100644 --- a/src/wayland/handlers/compositor.rs +++ b/src/wayland/handlers/compositor.rs @@ -134,7 +134,7 @@ impl CompositorHandler for State { } fn commit(&mut self, surface: &WlSurface) { - X11Wm::commit_hook::(surface); + X11Wm::commit_hook::(self, surface); // first load the buffer for various smithay helper functions (which also initializes the RendererSurfaceState) on_commit_buffer_handler::(surface); diff --git a/src/wayland/handlers/fixes.rs b/src/wayland/handlers/fixes.rs new file mode 100644 index 00000000..b589aabc --- /dev/null +++ b/src/wayland/handlers/fixes.rs @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-only + +use crate::state::State; +use smithay::delegate_fixes; + +delegate_fixes!(State); diff --git a/src/wayland/handlers/mod.rs b/src/wayland/handlers/mod.rs index 6b9c7c2d..ae889d79 100644 --- a/src/wayland/handlers/mod.rs +++ b/src/wayland/handlers/mod.rs @@ -8,6 +8,7 @@ pub mod decoration; pub mod dmabuf; pub mod drm; pub mod drm_lease; +pub mod fixes; pub mod fractional_scale; pub mod idle_inhibit; pub mod idle_notify; @@ -38,3 +39,4 @@ pub mod workspace; pub mod xdg_activation; pub mod xdg_shell; pub mod xwayland_keyboard_grab; +pub mod xwayland_shell; diff --git a/src/wayland/handlers/xwayland_shell.rs b/src/wayland/handlers/xwayland_shell.rs new file mode 100644 index 00000000..a710c708 --- /dev/null +++ b/src/wayland/handlers/xwayland_shell.rs @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-3.0-only + +use crate::state::State; +use smithay::{ + delegate_xwayland_shell, + wayland::xwayland_shell::{XWaylandShellHandler, XWaylandShellState}, +}; + +impl XWaylandShellHandler for State { + fn xwayland_shell_state(&mut self) -> &mut XWaylandShellState { + &mut self.common.xwayland_shell_state + } +} + +delegate_xwayland_shell!(State); diff --git a/src/xwayland.rs b/src/xwayland.rs index fe0f3838..3c5f32ea 100644 --- a/src/xwayland.rs +++ b/src/xwayland.rs @@ -83,7 +83,6 @@ impl State { let mut wm = match X11Wm::start_wm( data.common.event_loop_handle.clone(), - data.common.display_handle.clone(), x11_socket, client.clone(), ) {