1
0
Fork 0
forked from wry/wry

wayland: make object versions type safe

This commit is contained in:
Julian Orth 2024-04-08 14:47:50 +02:00
parent 0d7b45d149
commit e3a1a0b30f
50 changed files with 198 additions and 173 deletions

View file

@ -15,7 +15,7 @@ use {
xdg_toplevel_drag_v1::XdgToplevelDragV1,
},
leaks::Tracker,
object::Object,
object::{Object, Version},
rect::Rect,
renderer::Renderer,
state::State,
@ -74,8 +74,8 @@ const CAP_FULLSCREEN: u32 = 3;
#[allow(dead_code)]
const CAP_MINIMIZE: u32 = 4;
pub const WM_CAPABILITIES_SINCE: u32 = 5;
pub const SUSPENDED_SINCE: u32 = 6;
pub const WM_CAPABILITIES_SINCE: Version = Version(5);
pub const SUSPENDED_SINCE: Version = Version(6);
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Decoration {

View file

@ -4,7 +4,7 @@ use {
globals::{Global, GlobalName},
ifs::wl_surface::{x_surface::xwayland_surface_v1::XwaylandSurfaceV1, WlSurfaceError},
leaks::Tracker,
object::Object,
object::{Object, Version},
utils::buffd::{MsgParser, MsgParserError},
wire::{xwayland_shell_v1::*, WlSurfaceId, XwaylandShellV1Id},
},
@ -19,7 +19,7 @@ pub struct XwaylandShellV1Global {
pub struct XwaylandShellV1 {
id: XwaylandShellV1Id,
client: Rc<Client>,
pub version: u32,
pub version: Version,
pub tracker: Tracker<Self>,
}
@ -32,7 +32,7 @@ impl XwaylandShellV1Global {
self: Rc<Self>,
id: XwaylandShellV1Id,
client: &Rc<Client>,
version: u32,
version: Version,
) -> Result<(), XwaylandShellV1Error> {
let obj = Rc::new(XwaylandShellV1 {
id,