1
0
Fork 0
forked from wry/wry

xdg-popup: implement jay-popup-ext-v1

This commit is contained in:
Julian Orth 2025-12-16 20:21:10 +01:00
parent 15e6ab2b8a
commit 1d3dfa8b3a
12 changed files with 473 additions and 8 deletions

View file

@ -79,6 +79,11 @@ pub const SUSPENDED_SINCE: Version = Version(6);
pub const TILED_SINCE: Version = Version(2);
pub const CONSTRAINTS_SINCE: Version = Version(7);
const RESIZE_EDGE_TOP: u32 = 1;
const RESIZE_EDGE_BOTTOM: u32 = 2;
const RESIZE_EDGE_LEFT: u32 = 4;
const RESIZE_EDGE_RIGHT: u32 = 8;
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Decoration {
#[expect(dead_code)]
@ -834,6 +839,18 @@ pub enum XdgToplevelError {
}
efrom!(XdgToplevelError, ClientError);
pub fn map_resize_edges(edge: u32) -> Option<ResizeEdges> {
if !matches!(edge, 0 | 1 | 2 | 4 | 5 | 6 | 8 | 9 | 10) {
return None;
}
Some(ResizeEdges {
top: edge.contains(RESIZE_EDGE_TOP),
left: edge.contains(RESIZE_EDGE_LEFT),
right: edge.contains(RESIZE_EDGE_RIGHT),
bottom: edge.contains(RESIZE_EDGE_BOTTOM),
})
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct ResizeEdges {
pub top: bool,