2025-09-25 09:10:00 -04:00
|
|
|
use cosmic_protocols::corner_radius::v1::server::cosmic_corner_radius_toplevel_v1;
|
|
|
|
|
use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel;
|
2025-09-24 15:11:16 -04:00
|
|
|
use smithay::wayland::shell::xdg::ToplevelSurface;
|
|
|
|
|
|
|
|
|
|
use crate::wayland::protocols::corner_radius::{
|
2025-09-25 09:10:00 -04:00
|
|
|
delegate_corner_radius, CornerRadiusData, CornerRadiusHandler, CornerRadiusState,
|
2025-09-24 15:11:16 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
use crate::state::State;
|
|
|
|
|
|
|
|
|
|
impl CornerRadiusHandler for State {
|
2025-09-25 09:10:00 -04:00
|
|
|
fn corner_radius_state(&mut self) -> &mut CornerRadiusState {
|
2025-09-24 15:11:16 -04:00
|
|
|
&mut self.common.corner_radius_state
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn toplevel_from_resource(
|
|
|
|
|
&mut self,
|
2025-09-25 09:10:00 -04:00
|
|
|
toplevel: &xdg_toplevel::XdgToplevel,
|
2025-09-24 15:11:16 -04:00
|
|
|
) -> Option<ToplevelSurface> {
|
|
|
|
|
self.common.xdg_shell_state.get_toplevel(toplevel)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn set_corner_radius(
|
|
|
|
|
&mut self,
|
2025-09-25 09:10:00 -04:00
|
|
|
_toplevel: &cosmic_corner_radius_toplevel_v1::CosmicCornerRadiusToplevelV1,
|
2025-09-24 15:11:16 -04:00
|
|
|
_data: &CornerRadiusData,
|
|
|
|
|
_top_left: u32,
|
|
|
|
|
_top_right: u32,
|
|
|
|
|
_bottom_right: u32,
|
|
|
|
|
_bottom_left: u32,
|
|
|
|
|
) {
|
|
|
|
|
// TODO force redraw? of focus element?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn unset_corner_radius(
|
|
|
|
|
&mut self,
|
2025-09-25 09:10:00 -04:00
|
|
|
_toplevel: &cosmic_corner_radius_toplevel_v1::CosmicCornerRadiusToplevelV1,
|
2025-09-24 15:11:16 -04:00
|
|
|
_data: &CornerRadiusData,
|
|
|
|
|
) {
|
|
|
|
|
// TODO force redraw?
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delegate_corner_radius!(State);
|