Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wayland: implement xdg_toplevel v6 #77

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub enum ResizeEdge {

#[allow(dead_code)]
const STATE_MAXIMIZED: u32 = 1;
#[allow(dead_code)]
const STATE_FULLSCREEN: u32 = 2;
#[allow(dead_code)]
const STATE_RESIZING: u32 = 3;
Expand All @@ -60,6 +59,7 @@ const STATE_TILED_LEFT: u32 = 5;
const STATE_TILED_RIGHT: u32 = 6;
const STATE_TILED_TOP: u32 = 7;
const STATE_TILED_BOTTOM: u32 = 8;
const STATE_SUSPENDED: u32 = 9;

#[allow(dead_code)]
const CAP_WINDOW_MENU: u32 = 1;
Expand All @@ -70,6 +70,7 @@ const CAP_FULLSCREEN: u32 = 3;
const CAP_MINIMIZE: u32 = 4;

pub const WM_CAPABILITIES_SINCE: u32 = 5;
pub const SUSPENDED_SINCE: u32 = 6;

#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Decoration {
Expand Down Expand Up @@ -507,6 +508,14 @@ impl ToplevelNode for XdgToplevel {
// }
self.xdg.set_visible(visible);
self.toplevel_data.set_visible(self, visible);
if self.xdg.base.version >= SUSPENDED_SINCE {
if visible {
self.states.borrow_mut().remove(&STATE_SUSPENDED);
} else {
self.states.borrow_mut().insert(STATE_SUSPENDED);
}
self.send_current_configure();
}
}

fn tl_destroy(&self) {
Expand Down
2 changes: 1 addition & 1 deletion src/ifs/xdg_wm_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl Global for XdgWmBaseGlobal {
}

fn version(&self) -> u32 {
5
6
}
}

Expand Down
Loading