refactor: use cctk

This commit is contained in:
Ashley Wulber 2024-11-23 02:02:52 -05:00
parent 1b8a399ebd
commit 6e91eabf4c
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
46 changed files with 224 additions and 183 deletions

57
Cargo.lock generated
View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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,
};

View file

@ -1,4 +1,4 @@
use sctk::output::OutputInfo;
use cctk::sctk::output::OutputInfo;
/// output events
#[derive(Debug, Clone)]

View file

@ -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)]

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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 {

View file

@ -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"

View file

@ -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()
}),

View file

@ -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

View file

@ -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},
};

View file

@ -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

View file

@ -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)]

View file

@ -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" }

View file

@ -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<W: Window>(window: &W) -> Option<(u16, u16)> {
}
}
sctk::delegate_dmabuf!(AppData);
sctk::delegate_registry!(AppData);
cctk::sctk::delegate_dmabuf!(AppData);
cctk::sctk::delegate_registry!(AppData);

View file

@ -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

View file

@ -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 = [

View file

@ -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;

View file

@ -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
/// <https://wayland.app/protocols/wlr-layer-shell-unstable-v1#zwlr_layer_shell_v1:request:get_layer_surface>

View file

@ -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<Message>() -> Task<Message> {
task::effect(Action::PlatformSpecific(

View file

@ -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)]

View file

@ -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,

View file

@ -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`.

View file

@ -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 {

View file

@ -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},

View file

@ -1,5 +1,5 @@
// SPDX-License-Identifier: MPL-2.0-only
use sctk::{
use cctk::sctk::{
compositor::CompositorHandler,
delegate_compositor,
reexports::client::{

View file

@ -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},

View file

@ -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<Self>,
output: sctk::reexports::client::protocol::wl_output::WlOutput,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
output: sctk::reexports::client::protocol::wl_output::WlOutput,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
output: sctk::reexports::client::protocol::wl_output::WlOutput,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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?

View file

@ -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<Self>,
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<Self>,
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<Self>,
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<Self>,
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<Self>,
keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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) =

View file

@ -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<Self>,
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<Self>,
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)| {

View file

@ -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<Self>,
seat: sctk::reexports::client::protocol::wl_seat::WlSeat,
_conn: &cctk::sctk::reexports::client::Connection,
qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
seat: sctk::reexports::client::protocol::wl_seat::WlSeat,
capability: sctk::seat::Capability,
_conn: &cctk::sctk::reexports::client::Connection,
qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
seat: sctk::reexports::client::protocol::wl_seat::WlSeat,
capability: sctk::seat::Capability,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
seat: sctk::reexports::client::protocol::wl_seat::WlSeat,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat,
) {
self.sctk_events.push(SctkEvent::SeatEvent {
variant: SeatEventVariant::Remove,

View file

@ -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},

View file

@ -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::{

View file

@ -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<Self>,
layer: &sctk::shell::wlr_layer::LayerSurface,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
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<Self>,
layer: &cctk::sctk::shell::wlr_layer::LayerSurface,
mut configure: cctk::sctk::shell::wlr_layer::LayerSurfaceConfigure,
_serial: u32,
) {
self.request_redraw(layer.wl_surface());

View file

@ -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<Self>,
popup: &sctk::shell::xdg::popup::Popup,
configure: sctk::shell::xdg::popup::PopupConfigure,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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<Self>,
popup: &sctk::shell::xdg::popup::Popup,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
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()

View file

@ -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<Self>,
_window: &sctk::shell::xdg::window::Window,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
_window: &cctk::sctk::shell::xdg::window::Window,
) {
}
fn configure(
&mut self,
_conn: &sctk::reexports::client::Connection,
_qh: &sctk::reexports::client::QueueHandle<Self>,
_window: &sctk::shell::xdg::window::Window,
_configure: sctk::shell::xdg::window::WindowConfigure,
_conn: &cctk::sctk::reexports::client::Connection,
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
_window: &cctk::sctk::shell::xdg::window::Window,
_configure: cctk::sctk::shell::xdg::window::WindowConfigure,
_serial: u32,
) {
}

View file

@ -1,4 +1,4 @@
use crate::platform_specific::wayland::handlers::SctkState;
use sctk::delegate_subcompositor;
use cctk::sctk::delegate_subcompositor;
delegate_subcompositor!(SctkState);

View file

@ -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;

View file

@ -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;

View file

@ -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};

View file

@ -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<WpViewport>),
}
@ -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,

View file

@ -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 =

View file

@ -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},