feat(wayland): corner-radius protocol support
This commit is contained in:
parent
54a69a0523
commit
e73bbddbca
10 changed files with 252 additions and 62 deletions
|
|
@ -11,14 +11,14 @@ pub mod toplevel;
|
|||
pub mod wp_fractional_scaling;
|
||||
pub mod wp_viewporter;
|
||||
|
||||
use cctk::sctk::{
|
||||
use cctk::{sctk::{
|
||||
delegate_registry, delegate_shm,
|
||||
output::OutputState,
|
||||
registry::{ProvidesRegistryState, RegistryState},
|
||||
registry_handlers,
|
||||
seat::SeatState,
|
||||
shm::{Shm, ShmHandler},
|
||||
};
|
||||
}};
|
||||
|
||||
use crate::platform_specific::wayland::event_loop::state::SctkState;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ use crate::platform_specific::wayland::{
|
|||
event_loop::state::SctkState,
|
||||
sctk_event::{KeyboardEventVariant, SctkEvent},
|
||||
};
|
||||
use cctk::sctk::reexports::client::Proxy;
|
||||
use cctk::sctk::{
|
||||
delegate_keyboard,
|
||||
seat::keyboard::{KeyboardHandler, Keysym},
|
||||
};
|
||||
use cctk::sctk::{reexports::client::Proxy, seat::keyboard::RawModifiers};
|
||||
|
||||
impl KeyboardHandler for SctkState {
|
||||
fn enter(
|
||||
|
|
@ -232,7 +232,8 @@ impl KeyboardHandler for SctkState {
|
|||
keyboard: &cctk::sctk::reexports::client::protocol::wl_keyboard::WlKeyboard,
|
||||
_serial: u32,
|
||||
modifiers: cctk::sctk::seat::keyboard::Modifiers,
|
||||
layout: u32,
|
||||
_raw_modifiers: RawModifiers,
|
||||
_layout: u32,
|
||||
) {
|
||||
let (is_active, my_seat) =
|
||||
match self.seats.iter_mut().enumerate().find_map(|(i, s)| {
|
||||
|
|
@ -268,6 +269,17 @@ impl KeyboardHandler for SctkState {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn repeat_key(
|
||||
&mut self,
|
||||
_conn: &wayland_client::Connection,
|
||||
_qh: &wayland_client::QueueHandle<Self>,
|
||||
_keyboard: &wayland_client::protocol::wl_keyboard::WlKeyboard,
|
||||
_serial: u32,
|
||||
_event: cctk::sctk::seat::keyboard::KeyEvent,
|
||||
) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
delegate_keyboard!(SctkState);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
use cctk::{sctk, cosmic_protocols::{
|
||||
corner_radius::v1::client::{
|
||||
cosmic_corner_radius_manager_v1::CosmicCornerRadiusManagerV1,
|
||||
cosmic_corner_radius_toplevel_v1::CosmicCornerRadiusToplevelV1,
|
||||
},
|
||||
overlap_notify::v1::client::zcosmic_overlap_notification_v1::ZcosmicOverlapNotificationV1,
|
||||
}};
|
||||
use sctk::reexports::{
|
||||
client::{Connection, Dispatch, Proxy},
|
||||
|
||||
};
|
||||
|
||||
use crate::event_loop::state::SctkState;
|
||||
use crate::platform_specific::wayland::SctkEvent;
|
||||
|
||||
impl Dispatch<CosmicCornerRadiusManagerV1, ()> for SctkState {
|
||||
fn event(
|
||||
_state: &mut Self,
|
||||
_proxy: &CosmicCornerRadiusManagerV1,
|
||||
_event: <CosmicCornerRadiusManagerV1 as Proxy>::Event,
|
||||
_data: &(),
|
||||
_conn: &Connection,
|
||||
_qhandle: &sctk::reexports::client::QueueHandle<Self>,
|
||||
) {}
|
||||
}
|
||||
|
||||
impl
|
||||
Dispatch<
|
||||
CosmicCornerRadiusToplevelV1,
|
||||
(),
|
||||
> for SctkState
|
||||
{
|
||||
fn event(
|
||||
state: &mut Self,
|
||||
_proxy: &CosmicCornerRadiusToplevelV1,
|
||||
event: <CosmicCornerRadiusToplevelV1 as Proxy>::Event,
|
||||
_data: &(),
|
||||
_conn: &Connection,
|
||||
_qhandle: &sctk::reexports::client::QueueHandle<Self>,
|
||||
) {
|
||||
match event {
|
||||
_ => unimplemented!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
pub mod layer;
|
||||
pub mod xdg_popup;
|
||||
pub mod xdg_window;
|
||||
pub mod corner_radius;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue