From 6e91eabf4cfe97809463e8f4c896c8f62e6f4144 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Sat, 23 Nov 2024 02:02:52 -0500 Subject: [PATCH] refactor: use cctk --- Cargo.lock | 57 ++++++++++++++++--- Cargo.toml | 4 +- core/Cargo.toml | 6 +- core/src/event/wayland/mod.rs | 2 +- core/src/event/wayland/output.rs | 2 +- core/src/event/wayland/session_lock.rs | 2 +- examples/sctk_drag/Cargo.toml | 2 +- examples/sctk_subsurface/Cargo.toml | 3 +- examples/sctk_subsurface/src/main.rs | 2 +- examples/sctk_subsurface/src/wayland.rs | 4 +- examples/sctk_todos/Cargo.toml | 2 +- examples/sctk_todos/src/main.rs | 2 +- runtime/Cargo.toml | 6 +- .../wayland/layer_surface.rs | 2 +- .../src/platform_specific/wayland/popup.rs | 2 +- .../platform_specific/wayland/session_lock.rs | 2 +- wgpu/Cargo.toml | 2 +- wgpu/src/window/wayland.rs | 8 +-- widget/Cargo.toml | 6 +- winit/Cargo.toml | 6 +- winit/src/platform_specific/mod.rs | 10 ++-- .../wayland/commands/layer_surface.rs | 2 +- .../wayland/commands/session_lock.rs | 2 +- .../platform_specific/wayland/conversion.rs | 10 ++-- .../wayland/event_loop/mod.rs | 4 +- .../wayland/event_loop/proxy.rs | 2 +- .../wayland/event_loop/state.rs | 4 +- .../wayland/handlers/activation.rs | 2 +- .../wayland/handlers/compositor.rs | 2 +- .../platform_specific/wayland/handlers/mod.rs | 3 +- .../wayland/handlers/output.rs | 22 +++---- .../wayland/handlers/seat/keyboard.rs | 52 ++++++++--------- .../wayland/handlers/seat/pointer.rs | 10 ++-- .../wayland/handlers/seat/seat.rs | 46 +++++++-------- .../wayland/handlers/seat/touch.rs | 2 +- .../wayland/handlers/session_lock.rs | 2 +- .../wayland/handlers/shell/layer.rs | 16 +++--- .../wayland/handlers/shell/xdg_popup.rs | 16 +++--- .../wayland/handlers/shell/xdg_window.rs | 16 +++--- .../wayland/handlers/subcompositor.rs | 2 +- .../wayland/handlers/wp_fractional_scaling.rs | 16 +++--- .../wayland/handlers/wp_viewporter.rs | 14 ++--- winit/src/platform_specific/wayland/mod.rs | 6 +- .../platform_specific/wayland/sctk_event.rs | 14 ++--- .../wayland/subsurface_widget.rs | 6 +- .../platform_specific/wayland/winit_window.rs | 4 +- 46 files changed, 224 insertions(+), 183 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46930e5d..bb5111d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1280,6 +1280,32 @@ dependencies = [ "libm", ] +[[package]] +name = "cosmic-client-toolkit" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=27d70b6#27d70b6eb9c785a2a48341016f32a7b1ac4980ac" +dependencies = [ + "cosmic-protocols", + "libc", + "smithay-client-toolkit 0.19.2", + "wayland-client", + "wayland-protocols 0.32.9", +] + +[[package]] +name = "cosmic-protocols" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=27d70b6#27d70b6eb9c785a2a48341016f32a7b1ac4980ac" +dependencies = [ + "bitflags 2.10.0", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.32.9", + "wayland-protocols-wlr 0.3.9", + "wayland-scanner", + "wayland-server", +] + [[package]] name = "cosmic-text" version = "0.16.0" @@ -2960,6 +2986,7 @@ dependencies = [ "approx", "bitflags 2.10.0", "bytes", + "cosmic-client-toolkit", "dnd", "glam", "iced_accessibility", @@ -2970,7 +2997,6 @@ dependencies = [ "raw-window-handle", "rustc-hash 2.1.1", "serde", - "smithay-client-toolkit 0.19.2", "smol_str 0.3.2", "thiserror 2.0.17", "web-time", @@ -3064,6 +3090,7 @@ name = "iced_runtime" version = "0.14.0" dependencies = [ "bytes", + "cosmic-client-toolkit", "dnd", "iced_accessibility", "iced_core", @@ -3071,7 +3098,6 @@ dependencies = [ "iced_selector", "raw-window-handle", "sipper", - "smithay-client-toolkit 0.19.2", "thiserror 2.0.17", "window_clipboard", ] @@ -3131,6 +3157,7 @@ dependencies = [ "as-raw-xcb-connection", "bitflags 2.10.0", "bytemuck", + "cosmic-client-toolkit", "cryoglyph", "futures", "glam", @@ -3143,7 +3170,6 @@ dependencies = [ "resvg", "rustc-hash 2.1.1", "rustix 0.38.44", - "smithay-client-toolkit 0.19.2", "thiserror 2.0.17", "tiny-xlib", "wayland-backend", @@ -3158,6 +3184,7 @@ dependencies = [ name = "iced_widget" version = "0.14.2" dependencies = [ + "cosmic-client-toolkit", "dnd", "iced_accessibility", "iced_highlighter", @@ -3169,7 +3196,6 @@ dependencies = [ "pulldown-cmark", "qrcode", "rustc-hash 2.1.1", - "smithay-client-toolkit 0.19.2", "thiserror 2.0.17", "unicode-segmentation", "window_clipboard", @@ -3179,6 +3205,7 @@ dependencies = [ name = "iced_winit" version = "0.14.0" dependencies = [ + "cosmic-client-toolkit", "cursor-icon", "dnd", "iced_accessibility", @@ -3191,7 +3218,6 @@ dependencies = [ "mundy", "raw-window-handle", "rustc-hash 2.1.1", - "smithay-client-toolkit 0.19.2", "sysinfo", "thiserror 2.0.17", "tracing", @@ -5756,10 +5782,10 @@ dependencies = [ name = "sctk_drag" version = "0.1.0" dependencies = [ + "cosmic-client-toolkit", "env_logger", "iced", "iced_core", - "smithay-client-toolkit 0.19.2", ] [[package]] @@ -5785,12 +5811,12 @@ name = "sctk_subsurface" version = "0.1.0" dependencies = [ "calloop 0.12.4", + "cosmic-client-toolkit", "env_logger", "futures-channel", "iced", "iced_runtime", "rustix 0.38.44", - "smithay-client-toolkit 0.18.0", ] [[package]] @@ -5815,6 +5841,7 @@ name = "sctk_todos" version = "0.1.0" dependencies = [ "async-std", + "cosmic-client-toolkit", "directories-next", "env_logger", "iced", @@ -5823,7 +5850,6 @@ dependencies = [ "once_cell", "serde", "serde_json", - "smithay-client-toolkit 0.19.2", ] [[package]] @@ -7513,6 +7539,7 @@ dependencies = [ "wayland-backend", "wayland-client", "wayland-scanner", + "wayland-server", ] [[package]] @@ -7578,6 +7605,7 @@ dependencies = [ "wayland-client", "wayland-protocols 0.32.9", "wayland-scanner", + "wayland-server", ] [[package]] @@ -7591,6 +7619,19 @@ dependencies = [ "quote", ] +[[package]] +name = "wayland-server" +version = "0.31.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbd4f3aba6c9fba70445ad2a484c0ef0356c1a9459b1e8e435bedc1971a6222" +dependencies = [ + "bitflags 2.10.0", + "downcast-rs", + "rustix 1.1.2", + "wayland-backend", + "wayland-scanner", +] + [[package]] name = "wayland-sys" version = "0.31.7" diff --git a/Cargo.toml b/Cargo.toml index 0ae1a955..bc9fc06e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ wgpu-bare = ["iced_renderer/wgpu-bare", "iced_widget/wgpu"] # Enables the `tiny-skia` software renderer -default = ["tiny-skia", "tokio"] +default = ["tiny-skia", "tokio", "wayland", "x11"] # Enable the `tiny-skia` software renderer backend tiny-skia = ["iced_renderer/tiny-skia"] # Enables the `image` widget @@ -278,7 +278,7 @@ tiny-skia = { version = "0.11", default-features = false, features = [ "std", "simd", ] } -sctk = { package = "smithay-client-toolkit", version = "0.19.1" } +cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "27d70b6" } softbuffer = { git = "https://github.com/pop-os/softbuffer", tag = "cosmic-4.0" } syntect = "5.2" tokio = "1.0" diff --git a/core/Cargo.toml b/core/Cargo.toml index 0164ae39..44b2164e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -19,7 +19,7 @@ crisp = [] basic-shaping = [] advanced-shaping = [] a11y = ["iced_accessibility"] -wayland = ["sctk"] +wayland = ["cctk"] [dependencies] bitflags.workspace = true @@ -42,8 +42,8 @@ window_clipboard.workspace = true dnd.workspace = true mime.workspace = true -sctk.workspace = true -sctk.optional = true +cctk.workspace = true +cctk.optional = true # /TODO(POP) [dependencies.iced_accessibility] version = "0.1.0" diff --git a/core/src/event/wayland/mod.rs b/core/src/event/wayland/mod.rs index 0e908d67..dd63fdc8 100644 --- a/core/src/event/wayland/mod.rs +++ b/core/src/event/wayland/mod.rs @@ -6,7 +6,7 @@ mod session_lock; mod window; use crate::{time::Instant, window::Id}; -use sctk::reexports::client::protocol::{ +use cctk::sctk::reexports::client::protocol::{ wl_output::WlOutput, wl_seat::WlSeat, wl_surface::WlSurface, }; diff --git a/core/src/event/wayland/output.rs b/core/src/event/wayland/output.rs index c5024e85..4c7b6976 100644 --- a/core/src/event/wayland/output.rs +++ b/core/src/event/wayland/output.rs @@ -1,4 +1,4 @@ -use sctk::output::OutputInfo; +use cctk::sctk::output::OutputInfo; /// output events #[derive(Debug, Clone)] diff --git a/core/src/event/wayland/session_lock.rs b/core/src/event/wayland/session_lock.rs index db99566d..07e9f51e 100644 --- a/core/src/event/wayland/session_lock.rs +++ b/core/src/event/wayland/session_lock.rs @@ -1,5 +1,5 @@ use crate::window::Id; -use sctk::reexports::client::protocol::wl_surface::WlSurface; +use cctk::sctk::reexports::client::protocol::wl_surface::WlSurface; /// session lock events #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/examples/sctk_drag/Cargo.toml b/examples/sctk_drag/Cargo.toml index e118b277..20372d15 100644 --- a/examples/sctk_drag/Cargo.toml +++ b/examples/sctk_drag/Cargo.toml @@ -16,4 +16,4 @@ iced = { path = "../..", default-features = false, features = [ ] } env_logger = "0.10" # sctk = { package = "smithay-client-toolkit", path = "../../../fork/client-toolkit/" } -sctk.workspace = true +cctk.workspace = true diff --git a/examples/sctk_subsurface/Cargo.toml b/examples/sctk_subsurface/Cargo.toml index 30949510..126bc283 100644 --- a/examples/sctk_subsurface/Cargo.toml +++ b/examples/sctk_subsurface/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -sctk = { package = "smithay-client-toolkit", git = "https://github.com/smithay/client-toolkit", rev = "828b1eb" } +# sctk = { package = "smithay-client-toolkit", git = "https://github.com/smithay/client-toolkit", rev = "828b1eb" } iced = { path = "../..", default-features = false, features = [ "tokio", "wayland", @@ -17,3 +17,4 @@ env_logger = "0.10" futures-channel = "0.3.29" calloop = "0.12.3" rustix = { version = "0.38.30", features = ["fs", "shm"] } +cctk.workspace = true diff --git a/examples/sctk_subsurface/src/main.rs b/examples/sctk_subsurface/src/main.rs index 21a9a75f..9d31e08a 100644 --- a/examples/sctk_subsurface/src/main.rs +++ b/examples/sctk_subsurface/src/main.rs @@ -7,7 +7,7 @@ use iced::{ window::{self, Id, Settings}, Element, Length, Subscription, Task, }; -use sctk::reexports::client::{Connection, Proxy}; +use cctk::sctk::reexports::client::{Connection, Proxy}; mod wayland; diff --git a/examples/sctk_subsurface/src/wayland.rs b/examples/sctk_subsurface/src/wayland.rs index 315f1681..033dfc8e 100644 --- a/examples/sctk_subsurface/src/wayland.rs +++ b/examples/sctk_subsurface/src/wayland.rs @@ -5,7 +5,7 @@ use iced::{ }; use iced_runtime::futures::subscription; use rustix::{io::Errno, shm::ShmOFlags}; -use sctk::{ +use cctk::sctk::{ reexports::{ calloop_wayland_source::WaylandSource, client::{ @@ -40,7 +40,7 @@ impl ProvidesRegistryState for AppData { &mut self.registry_state } - sctk::registry_handlers!(); + cctk::sctk::registry_handlers!(); } impl ShmHandler for AppData { diff --git a/examples/sctk_todos/Cargo.toml b/examples/sctk_todos/Cargo.toml index 1638e2e1..fd14b95e 100644 --- a/examples/sctk_todos/Cargo.toml +++ b/examples/sctk_todos/Cargo.toml @@ -22,7 +22,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" iced_core.workspace = true once_cell = "1.15" -sctk.workspace = true +cctk.workspace = true log = "0.4.17" env_logger = "0.10.0" async-std = "1.0" diff --git a/examples/sctk_todos/src/main.rs b/examples/sctk_todos/src/main.rs index ce8e2c3f..7be16c83 100644 --- a/examples/sctk_todos/src/main.rs +++ b/examples/sctk_todos/src/main.rs @@ -96,7 +96,7 @@ impl Todos { get_layer_surface(iced::platform_specific::runtime::wayland::layer_surface::SctkLayerSurfaceSettings { size: Some((None, Some(500))), pointer_interactivity: true, - keyboard_interactivity: sctk::shell::wlr_layer::KeyboardInteractivity::OnDemand, + keyboard_interactivity: cctk::sctk::shell::wlr_layer::KeyboardInteractivity::OnDemand, anchor: Anchor::LEFT.union(Anchor::RIGHT).union(Anchor::TOP), ..Default::default() }), diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index d37b3936..eaa4031b 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -18,7 +18,7 @@ debug = [] selector = ["dep:iced_selector"] multi-window = [] a11y = ["iced_accessibility", "iced_core/a11y"] -wayland = ["iced_core/wayland", "sctk"] +wayland = ["iced_core/wayland", "cctk"] [dependencies] bytes.workspace = true @@ -34,8 +34,8 @@ sipper.optional = true iced_selector.workspace = true iced_selector.optional = true iced_futures.features = ["thread-pool"] -sctk.workspace = true -sctk.optional = true +cctk.workspace = true +cctk.optional = true iced_accessibility.workspace = true iced_accessibility.optional = true window_clipboard.workspace = true diff --git a/runtime/src/platform_specific/wayland/layer_surface.rs b/runtime/src/platform_specific/wayland/layer_surface.rs index 1629a463..f4419c96 100644 --- a/runtime/src/platform_specific/wayland/layer_surface.rs +++ b/runtime/src/platform_specific/wayland/layer_surface.rs @@ -1,7 +1,7 @@ use std::fmt; use iced_core::layout::Limits; -use sctk::{ +use cctk::sctk::{ reexports::client::protocol::wl_output::WlOutput, shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer}, }; diff --git a/runtime/src/platform_specific/wayland/popup.rs b/runtime/src/platform_specific/wayland/popup.rs index 615a6d49..19b23e02 100644 --- a/runtime/src/platform_specific/wayland/popup.rs +++ b/runtime/src/platform_specific/wayland/popup.rs @@ -4,7 +4,7 @@ use std::hash::{Hash, Hasher}; use iced_core::layout::Limits; use iced_core::window::Id; use iced_core::Rectangle; -use sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{ +use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{ Anchor, Gravity, }; /// Popup creation details diff --git a/runtime/src/platform_specific/wayland/session_lock.rs b/runtime/src/platform_specific/wayland/session_lock.rs index adbc2390..86a9337e 100644 --- a/runtime/src/platform_specific/wayland/session_lock.rs +++ b/runtime/src/platform_specific/wayland/session_lock.rs @@ -2,7 +2,7 @@ use std::fmt; use iced_core::window::Id; -use sctk::reexports::client::protocol::wl_output::WlOutput; +use cctk::sctk::reexports::client::protocol::wl_output::WlOutput; /// Session lock action #[derive(Clone)] diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 0bd8a78d..e4b01598 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -51,7 +51,7 @@ resvg.optional = true rustix = { version = "0.38" } raw-window-handle.workspace = true -sctk.workspace = true +cctk.workspace = true wayland-protocols.workspace = true wayland-backend = { version = "0.3.3", features = ["client_system"] } wayland-client = { version = "0.31.2" } diff --git a/wgpu/src/window/wayland.rs b/wgpu/src/window/wayland.rs index b50f5d69..031b8b2f 100644 --- a/wgpu/src/window/wayland.rs +++ b/wgpu/src/window/wayland.rs @@ -1,10 +1,10 @@ use crate::graphics::compositor::Window; -use raw_window_handle::{RawDisplayHandle, WaylandDisplayHandle}; -use sctk::{ +use cctk::sctk::{ dmabuf::{DmabufFeedback, DmabufHandler, DmabufState}, registry::{ProvidesRegistryState, RegistryState}, registry_handlers, }; +use raw_window_handle::{RawDisplayHandle, WaylandDisplayHandle}; use wayland_client::{ backend::Backend, globals::registry_queue_init, protocol::wl_buffer, Connection, QueueHandle, @@ -111,5 +111,5 @@ pub fn get_wayland_device_ids(window: &W) -> Option<(u16, u16)> { } } -sctk::delegate_dmabuf!(AppData); -sctk::delegate_registry!(AppData); +cctk::sctk::delegate_dmabuf!(AppData); +cctk::sctk::delegate_registry!(AppData); diff --git a/widget/Cargo.toml b/widget/Cargo.toml index cfe7c23c..e3c4796d 100644 --- a/widget/Cargo.toml +++ b/widget/Cargo.toml @@ -29,15 +29,15 @@ highlighter = ["dep:iced_highlighter"] advanced = [] crisp = [] a11y = ["iced_accessibility"] -wayland = ["sctk", "iced_runtime/wayland"] +wayland = ["cctk", "iced_runtime/wayland"] [dependencies] iced_renderer.workspace = true iced_runtime.workspace = true iced_accessibility.workspace = true iced_accessibility.optional = true -sctk.workspace = true -sctk.optional = true +cctk.workspace = true +cctk.optional = true num-traits.workspace = true log.workspace = true rustc-hash.workspace = true diff --git a/winit/Cargo.toml b/winit/Cargo.toml index f0985c92..d1850590 100644 --- a/winit/Cargo.toml +++ b/winit/Cargo.toml @@ -16,7 +16,7 @@ workspace = true [features] wayland = [ "winit/wayland", - "sctk", + "cctk", "wayland-protocols", "raw-window-handle", "iced_runtime/wayland", @@ -69,8 +69,8 @@ mundy.workspace = true mundy.optional = true raw-window-handle = { version = "0.6", optional = true } -sctk.workspace = true -sctk.optional = true +cctk.workspace = true +cctk.optional = true wayland-protocols.workspace = true wayland-protocols.optional = true wayland-backend = { version = "0.3.1", features = [ diff --git a/winit/src/platform_specific/mod.rs b/winit/src/platform_specific/mod.rs index 2ddaaa22..7969c203 100644 --- a/winit/src/platform_specific/mod.rs +++ b/winit/src/platform_specific/mod.rs @@ -3,10 +3,10 @@ use std::collections::HashMap; +#[cfg(all(feature = "wayland", target_os = "linux"))] +use cctk::sctk::reexports::client::Connection; use iced_graphics::{Compositor, compositor}; use iced_runtime::{core::window, platform_specific, user_interface}; -#[cfg(all(feature = "wayland", target_os = "linux"))] -use sctk::reexports::client::Connection; #[cfg(all(feature = "wayland", target_os = "linux"))] pub mod wayland; @@ -79,7 +79,7 @@ impl PlatformSpecific { ) { #[cfg(all(feature = "wayland", target_os = "linux"))] { - use sctk::reexports::client::{ + use cctk::sctk::reexports::client::{ Proxy, protocol::wl_surface::WlSurface, }; use wayland_backend::client::ObjectId; @@ -99,7 +99,9 @@ impl PlatformSpecific { wayland_display_handle.display.as_ptr().cast(), ) }; - sctk::reexports::client::Connection::from_backend(backend) + cctk::sctk::reexports::client::Connection::from_backend( + backend, + ) } _ => { return; diff --git a/winit/src/platform_specific/wayland/commands/layer_surface.rs b/winit/src/platform_specific/wayland/commands/layer_surface.rs index 84c580b4..839db95c 100644 --- a/winit/src/platform_specific/wayland/commands/layer_surface.rs +++ b/winit/src/platform_specific/wayland/commands/layer_surface.rs @@ -13,7 +13,7 @@ use iced_runtime::{ task, Action, Task, }; -pub use sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer}; +pub use cctk::sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer}; // TODO ASHLEY: maybe implement as builder that outputs a batched commands /// diff --git a/winit/src/platform_specific/wayland/commands/session_lock.rs b/winit/src/platform_specific/wayland/commands/session_lock.rs index 5a327552..d008b0d6 100644 --- a/winit/src/platform_specific/wayland/commands/session_lock.rs +++ b/winit/src/platform_specific/wayland/commands/session_lock.rs @@ -4,7 +4,7 @@ use iced_runtime::{ platform_specific::{self, wayland}, task, Action, Task, }; -use sctk::reexports::client::protocol::wl_output::WlOutput; +use cctk::sctk::reexports::client::protocol::wl_output::WlOutput; pub fn lock() -> Task { task::effect(Action::PlatformSpecific( diff --git a/winit/src/platform_specific/wayland/conversion.rs b/winit/src/platform_specific/wayland/conversion.rs index 5da22cc3..1db1abbb 100644 --- a/winit/src/platform_specific/wayland/conversion.rs +++ b/winit/src/platform_specific/wayland/conversion.rs @@ -1,8 +1,4 @@ -use iced_runtime::core::{ - keyboard, - mouse::{self, ScrollDelta}, -}; -use sctk::{ +use cctk::sctk::{ reexports::client::protocol::wl_pointer::AxisSource, seat::{ keyboard::Modifiers, @@ -11,6 +7,10 @@ use sctk::{ }, }, }; +use iced_runtime::core::{ + keyboard, + mouse::{self, ScrollDelta}, +}; /// An error that occurred while running an application. #[derive(Debug, thiserror::Error)] diff --git a/winit/src/platform_specific/wayland/event_loop/mod.rs b/winit/src/platform_specific/wayland/event_loop/mod.rs index afb26ae1..06356167 100644 --- a/winit/src/platform_specific/wayland/event_loop/mod.rs +++ b/winit/src/platform_specific/wayland/event_loop/mod.rs @@ -18,8 +18,8 @@ use crate::{ }; use raw_window_handle::HasDisplayHandle; -use sctk::reexports::calloop_wayland_source::WaylandSource; -use sctk::{ +use cctk::sctk::reexports::calloop_wayland_source::WaylandSource; +use cctk::sctk::{ activation::ActivationState, compositor::CompositorState, globals::GlobalData, diff --git a/winit/src/platform_specific/wayland/event_loop/proxy.rs b/winit/src/platform_specific/wayland/event_loop/proxy.rs index 7140cef7..44c0949e 100644 --- a/winit/src/platform_specific/wayland/event_loop/proxy.rs +++ b/winit/src/platform_specific/wayland/event_loop/proxy.rs @@ -3,7 +3,7 @@ use iced_futures::futures::{ task::{Context, Poll}, Sink, }; -use sctk::reexports::calloop; +use cctk::sctk::reexports::calloop; use std::pin::Pin; /// An event loop proxy that implements `Sink`. diff --git a/winit/src/platform_specific/wayland/event_loop/state.rs b/winit/src/platform_specific/wayland/event_loop/state.rs index bd5375fc..b18e4fda 100644 --- a/winit/src/platform_specific/wayland/event_loop/state.rs +++ b/winit/src/platform_specific/wayland/event_loop/state.rs @@ -39,7 +39,7 @@ use iced_runtime::{ }, }, }; -use sctk::{ +use cctk::sctk::{ activation::{ActivationState, RequestData}, compositor::CompositorState, error::GlobalError, @@ -980,7 +980,7 @@ impl SctkState { } } if self.pending_popup.replace((popup, 0)).is_none() { - let timer = sctk::reexports::calloop::timer::Timer::from_duration(Duration::from_millis(30)); + let timer = cctk::sctk::reexports::calloop::timer::Timer::from_duration(Duration::from_millis(30)); let queue_handle = self.queue_handle.clone(); _ = self.loop_handle.insert_source(timer, move |_, _, state| { let Some((popup, attempt)) = state.pending_popup.take() else { diff --git a/winit/src/platform_specific/wayland/handlers/activation.rs b/winit/src/platform_specific/wayland/handlers/activation.rs index 5b8b0f5a..26cfbeb8 100644 --- a/winit/src/platform_specific/wayland/handlers/activation.rs +++ b/winit/src/platform_specific/wayland/handlers/activation.rs @@ -1,5 +1,5 @@ use iced_futures::futures::channel::oneshot::Sender; -use sctk::{ +use cctk::sctk::{ activation::{ActivationHandler, RequestData, RequestDataExt}, delegate_activation, reexports::client::protocol::{wl_seat::WlSeat, wl_surface::WlSurface}, diff --git a/winit/src/platform_specific/wayland/handlers/compositor.rs b/winit/src/platform_specific/wayland/handlers/compositor.rs index a1b63683..92b5c773 100644 --- a/winit/src/platform_specific/wayland/handlers/compositor.rs +++ b/winit/src/platform_specific/wayland/handlers/compositor.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MPL-2.0-only -use sctk::{ +use cctk::sctk::{ compositor::CompositorHandler, delegate_compositor, reexports::client::{ diff --git a/winit/src/platform_specific/wayland/handlers/mod.rs b/winit/src/platform_specific/wayland/handlers/mod.rs index e584f44d..28264f1f 100644 --- a/winit/src/platform_specific/wayland/handlers/mod.rs +++ b/winit/src/platform_specific/wayland/handlers/mod.rs @@ -2,6 +2,7 @@ pub mod activation; pub mod compositor; pub mod output; +// pub mod overlap; pub mod seat; pub mod session_lock; pub mod shell; @@ -9,7 +10,7 @@ pub mod subcompositor; pub mod wp_fractional_scaling; pub mod wp_viewporter; -use sctk::{ +use cctk::sctk::{ delegate_registry, delegate_shm, output::OutputState, registry::{ProvidesRegistryState, RegistryState}, diff --git a/winit/src/platform_specific/wayland/handlers/output.rs b/winit/src/platform_specific/wayland/handlers/output.rs index 8bc92917..bc227ea9 100644 --- a/winit/src/platform_specific/wayland/handlers/output.rs +++ b/winit/src/platform_specific/wayland/handlers/output.rs @@ -1,18 +1,18 @@ use crate::platform_specific::wayland::{ event_loop::state::SctkState, sctk_event::SctkEvent, }; -use sctk::{delegate_output, output::OutputHandler}; +use cctk::sctk::{delegate_output, output::OutputHandler}; impl OutputHandler for SctkState { - fn output_state(&mut self) -> &mut sctk::output::OutputState { + fn output_state(&mut self) -> &mut cctk::sctk::output::OutputState { &mut self.output_state } fn new_output( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - output: sctk::reexports::client::protocol::wl_output::WlOutput, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + output: cctk::sctk::reexports::client::protocol::wl_output::WlOutput, ) { self.sctk_events.push(SctkEvent::NewOutput { id: output.clone(), @@ -23,9 +23,9 @@ impl OutputHandler for SctkState { fn update_output( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - output: sctk::reexports::client::protocol::wl_output::WlOutput, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + output: cctk::sctk::reexports::client::protocol::wl_output::WlOutput, ) { if let Some(info) = self.output_state.info(&output) { self.sctk_events.push(SctkEvent::UpdateOutput { @@ -37,9 +37,9 @@ impl OutputHandler for SctkState { fn output_destroyed( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - output: sctk::reexports::client::protocol::wl_output::WlOutput, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + output: cctk::sctk::reexports::client::protocol::wl_output::WlOutput, ) { self.sctk_events.push(SctkEvent::RemovedOutput(output)); // TODO clean up any layer surfaces on this output? diff --git a/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs b/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs index f4896f0c..7b12661f 100644 --- a/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs +++ b/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs @@ -2,8 +2,8 @@ use crate::platform_specific::wayland::{ event_loop::state::SctkState, sctk_event::{KeyboardEventVariant, SctkEvent}, }; -use sctk::reexports::client::Proxy; -use sctk::{ +use cctk::sctk::reexports::client::Proxy; +use cctk::sctk::{ delegate_keyboard, seat::keyboard::{KeyboardHandler, Keysym}, }; @@ -11,10 +11,10 @@ use sctk::{ impl KeyboardHandler for SctkState { fn enter( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, - surface: &sctk::reexports::client::protocol::wl_surface::WlSurface, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + keyboard: &cctk::sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, + surface: &cctk::sctk::reexports::client::protocol::wl_surface::WlSurface, _serial: u32, _raw: &[u32], _keysyms: &[Keysym], @@ -57,20 +57,20 @@ impl KeyboardHandler for SctkState { winit::event::WindowEvent::Focused(true), )); self.sctk_events.push(SctkEvent::KeyboardEvent { - variant: KeyboardEventVariant::Enter(surface.clone()), - kbd_id: keyboard.clone(), - seat_id: seat, - surface: surface.clone(), + variant: KeyboardEventVariant::Enter(surface.clone()), + kbd_id: keyboard.clone(), + seat_id: seat, + surface: surface.clone(), }); } } fn leave( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, - surface: &sctk::reexports::client::protocol::wl_surface::WlSurface, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + keyboard: &cctk::sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, + surface: &cctk::sctk::reexports::client::protocol::wl_surface::WlSurface, _serial: u32, ) { self.request_redraw(surface); @@ -129,11 +129,11 @@ impl KeyboardHandler for SctkState { fn press_key( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + keyboard: &cctk::sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, serial: u32, - event: sctk::seat::keyboard::KeyEvent, + event: cctk::sctk::seat::keyboard::KeyEvent, ) { let (is_active, my_seat) = match self.seats.iter_mut().enumerate().find_map(|(i, s)| { @@ -185,11 +185,11 @@ impl KeyboardHandler for SctkState { fn release_key( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + keyboard: &cctk::sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, _serial: u32, - event: sctk::seat::keyboard::KeyEvent, + event: cctk::sctk::seat::keyboard::KeyEvent, ) { let (is_active, my_seat) = match self.seats.iter_mut().enumerate().find_map(|(i, s)| { @@ -220,11 +220,11 @@ impl KeyboardHandler for SctkState { fn update_modifiers( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + keyboard: &cctk::sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, _serial: u32, - modifiers: sctk::seat::keyboard::Modifiers, + modifiers: cctk::sctk::seat::keyboard::Modifiers, layout: u32, ) { let (is_active, my_seat) = diff --git a/winit/src/platform_specific/wayland/handlers/seat/pointer.rs b/winit/src/platform_specific/wayland/handlers/seat/pointer.rs index 600e344c..3cace7bc 100644 --- a/winit/src/platform_specific/wayland/handlers/seat/pointer.rs +++ b/winit/src/platform_specific/wayland/handlers/seat/pointer.rs @@ -4,7 +4,7 @@ use crate::{ event_loop::state::SctkState, sctk_event::SctkEvent, }, }; -use sctk::{ +use cctk::sctk::{ delegate_pointer, reexports::client::Proxy, seat::pointer::{ @@ -22,10 +22,10 @@ use winit::{ impl PointerHandler for SctkState { fn pointer_frame( &mut self, - conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - pointer: &sctk::reexports::client::protocol::wl_pointer::WlPointer, - events: &[sctk::seat::pointer::PointerEvent], + conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + pointer: &cctk::sctk::reexports::client::protocol::wl_pointer::WlPointer, + events: &[cctk::sctk::seat::pointer::PointerEvent], ) { let (is_active, my_seat) = match self.seats.iter_mut().enumerate().find_map(|(i, s)| { diff --git a/winit/src/platform_specific/wayland/handlers/seat/seat.rs b/winit/src/platform_specific/wayland/handlers/seat/seat.rs index ee7d83e5..71ae42de 100644 --- a/winit/src/platform_specific/wayland/handlers/seat/seat.rs +++ b/winit/src/platform_specific/wayland/handlers/seat/seat.rs @@ -2,23 +2,23 @@ use crate::platform_specific::wayland::{ event_loop::{state::SctkSeat, state::SctkState}, sctk_event::{KeyboardEventVariant, SctkEvent, SeatEventVariant}, }; -use iced_runtime::keyboard::Modifiers; -use sctk::{ +use cctk::sctk::{ delegate_seat, reexports::client::{protocol::wl_keyboard::WlKeyboard, Proxy}, seat::{pointer::ThemeSpec, SeatHandler}, }; +use iced_runtime::keyboard::Modifiers; impl SeatHandler for SctkState { - fn seat_state(&mut self) -> &mut sctk::seat::SeatState { + fn seat_state(&mut self) -> &mut cctk::sctk::seat::SeatState { &mut self.seat_state } fn new_seat( &mut self, - _conn: &sctk::reexports::client::Connection, - qh: &sctk::reexports::client::QueueHandle, - seat: sctk::reexports::client::protocol::wl_seat::WlSeat, + _conn: &cctk::sctk::reexports::client::Connection, + qh: &cctk::sctk::reexports::client::QueueHandle, + seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat, ) { self.sctk_events.push(SctkEvent::SeatEvent { variant: SeatEventVariant::New, @@ -43,10 +43,10 @@ impl SeatHandler for SctkState { fn new_capability( &mut self, - _conn: &sctk::reexports::client::Connection, - qh: &sctk::reexports::client::QueueHandle, - seat: sctk::reexports::client::protocol::wl_seat::WlSeat, - capability: sctk::seat::Capability, + _conn: &cctk::sctk::reexports::client::Connection, + qh: &cctk::sctk::reexports::client::QueueHandle, + seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat, + capability: cctk::sctk::seat::Capability, ) { let my_seat = match self.seats.iter_mut().find(|s| s.seat == seat) { Some(s) => s, @@ -71,7 +71,7 @@ impl SeatHandler for SctkState { }; // TODO data device match capability { - sctk::seat::Capability::Keyboard => { + cctk::sctk::seat::Capability::Keyboard => { let seat_clone = seat.clone(); let seat_clone_2 = seat.clone(); if let Ok(kbd) = self.seat_state.get_keyboard_with_repeat( @@ -107,7 +107,7 @@ impl SeatHandler for SctkState { _ = my_seat.kbd.replace(kbd); } } - sctk::seat::Capability::Pointer => { + cctk::sctk::seat::Capability::Pointer => { let surface = self.compositor_state.create_surface(qh); if let Ok(ptr) = self.seat_state.get_pointer_with_theme( @@ -127,7 +127,7 @@ impl SeatHandler for SctkState { _ = my_seat.ptr.replace(ptr); } } - sctk::seat::Capability::Touch => { + cctk::sctk::seat::Capability::Touch => { if let Some(touch) = self.seat_state.get_touch(qh, &seat).ok() { self.sctk_events.push(SctkEvent::SeatEvent { variant: SeatEventVariant::NewCapability( @@ -145,10 +145,10 @@ impl SeatHandler for SctkState { fn remove_capability( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - seat: sctk::reexports::client::protocol::wl_seat::WlSeat, - capability: sctk::seat::Capability, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat, + capability: cctk::sctk::seat::Capability, ) { let my_seat = match self.seats.iter_mut().find(|s| s.seat == seat) { Some(s) => s, @@ -158,7 +158,7 @@ impl SeatHandler for SctkState { // TODO data device match capability { // TODO use repeating kbd? - sctk::seat::Capability::Keyboard => { + cctk::sctk::seat::Capability::Keyboard => { if let Some(kbd) = my_seat.kbd.take() { self.sctk_events.push(SctkEvent::SeatEvent { variant: SeatEventVariant::RemoveCapability( @@ -169,7 +169,7 @@ impl SeatHandler for SctkState { }); } } - sctk::seat::Capability::Pointer => { + cctk::sctk::seat::Capability::Pointer => { if let Some(ptr) = my_seat.ptr.take() { self.sctk_events.push(SctkEvent::SeatEvent { variant: SeatEventVariant::RemoveCapability( @@ -180,7 +180,7 @@ impl SeatHandler for SctkState { }); } } - sctk::seat::Capability::Touch => { + cctk::sctk::seat::Capability::Touch => { if let Some(touch) = my_seat.touch.take() { self.sctk_events.push(SctkEvent::SeatEvent { variant: SeatEventVariant::RemoveCapability( @@ -197,9 +197,9 @@ impl SeatHandler for SctkState { fn remove_seat( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - seat: sctk::reexports::client::protocol::wl_seat::WlSeat, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat, ) { self.sctk_events.push(SctkEvent::SeatEvent { variant: SeatEventVariant::Remove, diff --git a/winit/src/platform_specific/wayland/handlers/seat/touch.rs b/winit/src/platform_specific/wayland/handlers/seat/touch.rs index 99e6caca..0ac17a50 100644 --- a/winit/src/platform_specific/wayland/handlers/seat/touch.rs +++ b/winit/src/platform_specific/wayland/handlers/seat/touch.rs @@ -7,7 +7,7 @@ use crate::{ }, }; use iced_runtime::core::{touch, Point}; -use sctk::{ +use cctk::sctk::{ delegate_touch, reexports::client::{ protocol::{wl_surface::WlSurface, wl_touch::WlTouch}, diff --git a/winit/src/platform_specific/wayland/handlers/session_lock.rs b/winit/src/platform_specific/wayland/handlers/session_lock.rs index 27ae70b7..04945b3b 100644 --- a/winit/src/platform_specific/wayland/handlers/session_lock.rs +++ b/winit/src/platform_specific/wayland/handlers/session_lock.rs @@ -1,7 +1,7 @@ use crate::platform_specific::wayland::{ handlers::SctkState, sctk_event::SctkEvent, }; -use sctk::{ +use cctk::sctk::{ delegate_session_lock, reexports::client::{Connection, QueueHandle}, session_lock::{ diff --git a/winit/src/platform_specific/wayland/handlers/shell/layer.rs b/winit/src/platform_specific/wayland/handlers/shell/layer.rs index d7d8b3e8..174127ee 100644 --- a/winit/src/platform_specific/wayland/handlers/shell/layer.rs +++ b/winit/src/platform_specific/wayland/handlers/shell/layer.rs @@ -2,7 +2,7 @@ use crate::platform_specific::wayland::{ event_loop::state::SctkState, sctk_event::{LayerSurfaceEventVariant, SctkEvent}, }; -use sctk::{ +use cctk::sctk::{ delegate_layer, reexports::client::Proxy, shell::{ @@ -16,9 +16,9 @@ use winit::dpi::LogicalSize; impl LayerShellHandler for SctkState { fn closed( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - layer: &sctk::shell::wlr_layer::LayerSurface, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + layer: &cctk::sctk::shell::wlr_layer::LayerSurface, ) { let layer = match self.layer_surfaces.iter().position(|s| { s.surface.wl_surface().id() == layer.wl_surface().id() @@ -36,10 +36,10 @@ impl LayerShellHandler for SctkState { fn configure( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - layer: &sctk::shell::wlr_layer::LayerSurface, - mut configure: sctk::shell::wlr_layer::LayerSurfaceConfigure, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + layer: &cctk::sctk::shell::wlr_layer::LayerSurface, + mut configure: cctk::sctk::shell::wlr_layer::LayerSurfaceConfigure, _serial: u32, ) { self.request_redraw(layer.wl_surface()); diff --git a/winit/src/platform_specific/wayland/handlers/shell/xdg_popup.rs b/winit/src/platform_specific/wayland/handlers/shell/xdg_popup.rs index 0975dc0b..c48c6bce 100644 --- a/winit/src/platform_specific/wayland/handlers/shell/xdg_popup.rs +++ b/winit/src/platform_specific/wayland/handlers/shell/xdg_popup.rs @@ -2,7 +2,7 @@ use crate::platform_specific::wayland::{ event_loop::state::{self, PopupParent, SctkState}, sctk_event::{PopupEventVariant, SctkEvent}, }; -use sctk::{ +use cctk::sctk::{ delegate_xdg_popup, reexports::client::Proxy, shell::xdg::popup::PopupHandler, }; @@ -10,10 +10,10 @@ use sctk::{ impl PopupHandler for SctkState { fn configure( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - popup: &sctk::shell::xdg::popup::Popup, - configure: sctk::shell::xdg::popup::PopupConfigure, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + popup: &cctk::sctk::shell::xdg::popup::Popup, + configure: cctk::sctk::shell::xdg::popup::PopupConfigure, ) { self.request_redraw(popup.wl_surface()); let sctk_popup = match self.popups.iter_mut().find(|s| { @@ -43,9 +43,9 @@ impl PopupHandler for SctkState { fn done( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - popup: &sctk::shell::xdg::popup::Popup, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + popup: &cctk::sctk::shell::xdg::popup::Popup, ) { let sctk_popup = match self.popups.iter().position(|s| { s.popup.wl_surface().clone() == popup.wl_surface().clone() diff --git a/winit/src/platform_specific/wayland/handlers/shell/xdg_window.rs b/winit/src/platform_specific/wayland/handlers/shell/xdg_window.rs index 24da3cfa..43881610 100644 --- a/winit/src/platform_specific/wayland/handlers/shell/xdg_window.rs +++ b/winit/src/platform_specific/wayland/handlers/shell/xdg_window.rs @@ -1,23 +1,23 @@ use crate::platform_specific::wayland::event_loop::state::SctkState; -use sctk::{ +use cctk::sctk::{ delegate_xdg_shell, delegate_xdg_window, shell::xdg::window::WindowHandler, }; impl WindowHandler for SctkState { fn request_close( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - _window: &sctk::shell::xdg::window::Window, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + _window: &cctk::sctk::shell::xdg::window::Window, ) { } fn configure( &mut self, - _conn: &sctk::reexports::client::Connection, - _qh: &sctk::reexports::client::QueueHandle, - _window: &sctk::shell::xdg::window::Window, - _configure: sctk::shell::xdg::window::WindowConfigure, + _conn: &cctk::sctk::reexports::client::Connection, + _qh: &cctk::sctk::reexports::client::QueueHandle, + _window: &cctk::sctk::shell::xdg::window::Window, + _configure: cctk::sctk::shell::xdg::window::WindowConfigure, _serial: u32, ) { } diff --git a/winit/src/platform_specific/wayland/handlers/subcompositor.rs b/winit/src/platform_specific/wayland/handlers/subcompositor.rs index 40f9a0db..4bfbfab1 100644 --- a/winit/src/platform_specific/wayland/handlers/subcompositor.rs +++ b/winit/src/platform_specific/wayland/handlers/subcompositor.rs @@ -1,4 +1,4 @@ use crate::platform_specific::wayland::handlers::SctkState; -use sctk::delegate_subcompositor; +use cctk::sctk::delegate_subcompositor; delegate_subcompositor!(SctkState); diff --git a/winit/src/platform_specific/wayland/handlers/wp_fractional_scaling.rs b/winit/src/platform_specific/wayland/handlers/wp_fractional_scaling.rs index 00c675d5..6d188a03 100644 --- a/winit/src/platform_specific/wayland/handlers/wp_fractional_scaling.rs +++ b/winit/src/platform_specific/wayland/handlers/wp_fractional_scaling.rs @@ -1,15 +1,15 @@ // From: https://github.com/rust-windowing/winit/blob/master/src/platform_impl/linux/wayland/types/wp_fractional_scaling.rs //! Handling of the fractional scaling. -use sctk::reexports::client::globals::{BindError, GlobalList}; -use sctk::reexports::client::protocol::wl_surface::WlSurface; -use sctk::reexports::client::Dispatch; -use sctk::reexports::client::{delegate_dispatch, Connection, Proxy, QueueHandle}; -use sctk::reexports::protocols::wp::fractional_scale::v1::client::wp_fractional_scale_manager_v1::WpFractionalScaleManagerV1; -use sctk::reexports::protocols::wp::fractional_scale::v1::client::wp_fractional_scale_v1::Event as FractionalScalingEvent; -use sctk::reexports::protocols::wp::fractional_scale::v1::client::wp_fractional_scale_v1::WpFractionalScaleV1; +use cctk::sctk::reexports::client::globals::{BindError, GlobalList}; +use cctk::sctk::reexports::client::protocol::wl_surface::WlSurface; +use cctk::sctk::reexports::client::Dispatch; +use cctk::sctk::reexports::client::{delegate_dispatch, Connection, Proxy, QueueHandle}; +use cctk::sctk::reexports::protocols::wp::fractional_scale::v1::client::wp_fractional_scale_manager_v1::WpFractionalScaleManagerV1; +use cctk::sctk::reexports::protocols::wp::fractional_scale::v1::client::wp_fractional_scale_v1::Event as FractionalScalingEvent; +use cctk::sctk::reexports::protocols::wp::fractional_scale::v1::client::wp_fractional_scale_v1::WpFractionalScaleV1; -use sctk::globals::GlobalData; +use cctk::sctk::globals::GlobalData; use crate::platform_specific::wayland::event_loop::state::SctkState; diff --git a/winit/src/platform_specific/wayland/handlers/wp_viewporter.rs b/winit/src/platform_specific/wayland/handlers/wp_viewporter.rs index 8eacfbd3..5cfe28d7 100644 --- a/winit/src/platform_specific/wayland/handlers/wp_viewporter.rs +++ b/winit/src/platform_specific/wayland/handlers/wp_viewporter.rs @@ -1,15 +1,15 @@ //! Handling of the wp-viewporter. -use sctk::reexports::client::globals::{BindError, GlobalList}; -use sctk::reexports::client::protocol::wl_surface::WlSurface; -use sctk::reexports::client::Dispatch; -use sctk::reexports::client::{ +use cctk::sctk::reexports::client::globals::{BindError, GlobalList}; +use cctk::sctk::reexports::client::protocol::wl_surface::WlSurface; +use cctk::sctk::reexports::client::Dispatch; +use cctk::sctk::reexports::client::{ delegate_dispatch, Connection, Proxy, QueueHandle, }; -use sctk::reexports::protocols::wp::viewporter::client::wp_viewport::WpViewport; -use sctk::reexports::protocols::wp::viewporter::client::wp_viewporter::WpViewporter; +use cctk::sctk::reexports::protocols::wp::viewporter::client::wp_viewport::WpViewport; +use cctk::sctk::reexports::protocols::wp::viewporter::client::wp_viewporter::WpViewporter; -use sctk::globals::GlobalData; +use cctk::sctk::globals::GlobalData; use crate::platform_specific::wayland::event_loop::state::SctkState; diff --git a/winit/src/platform_specific/wayland/mod.rs b/winit/src/platform_specific/wayland/mod.rs index 6f414d26..81c4c0ad 100644 --- a/winit/src/platform_specific/wayland/mod.rs +++ b/winit/src/platform_specific/wayland/mod.rs @@ -11,13 +11,13 @@ use super::{PlatformSpecific, SurfaceIdWrapper}; use crate::{Control, Program, WindowManager}; use crate::platform_specific::UserInterfaces; +use cctk::sctk::reexports::calloop; +use cctk::sctk::reexports::client::protocol::wl_surface::WlSurface; +use cctk::sctk::seat::keyboard::Modifiers; use cursor_icon::CursorIcon; use iced_futures::futures::channel::mpsc; use iced_graphics::{Compositor, compositor}; use iced_runtime::core::window; -use sctk::reexports::calloop; -use sctk::reexports::client::protocol::wl_surface::WlSurface; -use sctk::seat::keyboard::Modifiers; use sctk_event::SctkEvent; use std::{collections::HashMap, sync::Arc}; use subsurface_widget::{SubsurfaceInstance, SubsurfaceState}; diff --git a/winit/src/platform_specific/wayland/sctk_event.rs b/winit/src/platform_specific/wayland/sctk_event.rs index df78f4be..2dade18d 100755 --- a/winit/src/platform_specific/wayland/sctk_event.rs +++ b/winit/src/platform_specific/wayland/sctk_event.rs @@ -37,7 +37,7 @@ use iced_runtime::{ user_interface, }; -use sctk::{ +use cctk::sctk::{ output::OutputInfo, reexports::{ calloop::channel, @@ -216,7 +216,7 @@ pub enum WindowEventVariant { Configure((NonZeroU32, NonZeroU32), WindowConfigure, WlSurface, bool), Size((NonZeroU32, NonZeroU32), WlSurface, bool), /// window state changed - StateChanged(sctk::reexports::csd_frame::WindowState), + StateChanged(cctk::sctk::reexports::csd_frame::WindowState), /// Scale Factor ScaleFactorChanged(f64, Option), } @@ -748,12 +748,11 @@ impl SctkEvent { ); } - let mut ui = crate::program::build_user_interface( + let mut ui = crate::build_user_interface( program, user_interface::Cache::default(), &mut window.renderer, logical_size, - debug, surface_id, window.raw.clone(), window.prev_dnd_destination_rectangles_count, @@ -949,8 +948,7 @@ impl SctkEvent { ); } - let window = window_manager.insert( -<<<<<<< HEAD + let window = window_manager.insert( surface_id, sctk_winit, program, @@ -959,14 +957,12 @@ impl SctkEvent { theme::Mode::None, // TODO do we really need to track the system theme here? ); let logical_size = window.logical_size(); - - let mut ui = crate::program::build_user_interface( + let mut ui = crate::build_user_interface( program, user_interface::Cache::default(), &mut window.renderer, logical_size, - debug, surface_id, window.raw.clone(), window.prev_dnd_destination_rectangles_count, diff --git a/winit/src/platform_specific/wayland/subsurface_widget.rs b/winit/src/platform_specific/wayland/subsurface_widget.rs index cb410efe..5d08dc4d 100644 --- a/winit/src/platform_specific/wayland/subsurface_widget.rs +++ b/winit/src/platform_specific/wayland/subsurface_widget.rs @@ -21,8 +21,7 @@ use std::{ }; use crate::futures::futures::channel::oneshot; -use iced_futures::core::window; -use sctk::{ +use cctk::sctk::{ compositor::SurfaceData, globals::GlobalData, reexports::client::{ @@ -38,6 +37,7 @@ use sctk::{ }, }, }; +use iced_futures::core::window; use wayland_backend::client::ObjectId; use wayland_protocols::wp::{ alpha_modifier::v1::client::{ @@ -346,7 +346,7 @@ impl SubsurfaceState { let wp_viewport = self.wp_viewporter.get_viewport( &wl_surface, &self.qh, - sctk::globals::GlobalData, + cctk::sctk::globals::GlobalData, ); let wp_alpha_modifier_surface = diff --git a/winit/src/platform_specific/wayland/winit_window.rs b/winit/src/platform_specific/wayland/winit_window.rs index f8342286..681f7f8f 100644 --- a/winit/src/platform_specific/wayland/winit_window.rs +++ b/winit/src/platform_specific/wayland/winit_window.rs @@ -1,12 +1,12 @@ use crate::platform_specific::wayland::Action; -use raw_window_handle::HandleError; -use sctk::reexports::{ +use cctk::sctk::reexports::{ calloop::channel, client::{ Proxy, QueueHandle, protocol::{wl_display::WlDisplay, wl_surface::WlSurface}, }, }; +use raw_window_handle::HandleError; use std::sync::{Arc, Mutex}; use winit::{ dpi::{LogicalSize, PhysicalPosition},