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

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