1
0
Fork 0
forked from wry/wry

wayland: implement xdg_toplevel.wm_capabilities

This commit is contained in:
Julian Orth 2022-06-01 23:32:56 +02:00
parent 6e244a08ab
commit 615d1953aa
4 changed files with 26 additions and 2 deletions

View file

@ -61,6 +61,16 @@ const STATE_TILED_RIGHT: u32 = 6;
const STATE_TILED_TOP: u32 = 7;
const STATE_TILED_BOTTOM: u32 = 8;
#[allow(dead_code)]
const CAP_WINDOW_MENU: u32 = 1;
#[allow(dead_code)]
const CAP_MAXIMIZE: u32 = 2;
const CAP_FULLSCREEN: u32 = 3;
#[allow(dead_code)]
const CAP_MINIMIZE: u32 = 4;
pub const WM_CAPABILITIES_SINCE: u32 = 5;
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Decoration {
#[allow(dead_code)]
@ -164,6 +174,13 @@ impl XdgToplevel {
})
}
pub fn send_wm_capabilities(&self) {
self.xdg.surface.client.event(WmCapabilities {
self_id: self.id,
capabilities: &[CAP_FULLSCREEN],
})
}
fn destroy(self: &Rc<Self>, parser: MsgParser<'_, '_>) -> Result<(), XdgToplevelError> {
let _req: Destroy = self.xdg.surface.client.parse(self.deref(), parser)?;
self.tl_destroy();