shell: empty (un)minimize handlers
This commit is contained in:
parent
3c3a5f2ccf
commit
068b70d4bc
4 changed files with 43 additions and 0 deletions
|
|
@ -230,6 +230,7 @@ pub struct WorkspaceSet {
|
|||
output: Output,
|
||||
theme: cosmic::Theme,
|
||||
pub sticky_layer: FloatingLayout,
|
||||
pub minimized_windows: Vec<MinimizedWindow>,
|
||||
pub workspaces: Vec<Workspace>,
|
||||
}
|
||||
|
||||
|
|
@ -351,6 +352,7 @@ impl WorkspaceSet {
|
|||
tiling_enabled,
|
||||
theme,
|
||||
sticky_layer,
|
||||
minimized_windows: Vec::new(),
|
||||
workspaces,
|
||||
output: output.clone(),
|
||||
}
|
||||
|
|
@ -978,6 +980,7 @@ impl Shell {
|
|||
[
|
||||
WmCapabilities::Fullscreen,
|
||||
WmCapabilities::Maximize,
|
||||
WmCapabilities::Minimize,
|
||||
WmCapabilities::WindowMenu,
|
||||
],
|
||||
);
|
||||
|
|
@ -2618,6 +2621,10 @@ impl Shell {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn minimize_request(&mut self, mapped: &CosmicMapped) {}
|
||||
|
||||
pub fn unminimize_request(&mut self, mapped: &CosmicMapped) {}
|
||||
|
||||
pub fn maximize_request(&mut self, mapped: &CosmicMapped) {
|
||||
let (original_layer, floating_layer, original_geometry) = if let Some(set) = self
|
||||
.workspaces
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ pub struct Workspace {
|
|||
pub output: Output,
|
||||
pub tiling_layer: TilingLayout,
|
||||
pub floating_layer: FloatingLayout,
|
||||
pub minimized_windows: Vec<MinimizedWindow>,
|
||||
pub tiling_enabled: bool,
|
||||
pub fullscreen: Option<FullscreenSurface>,
|
||||
|
||||
|
|
@ -90,6 +91,15 @@ pub struct Workspace {
|
|||
pub dirty: AtomicBool,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MinimizedWindow {
|
||||
pub window: CosmicMapped,
|
||||
pub previous_layer: ManagedLayer,
|
||||
pub was_fullscreen: Option<FullscreenSurface>,
|
||||
pub was_maximized: bool,
|
||||
pub tiling_state: Option<(id_tree::NodeId, Rectangle<i32, Logical>)>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FullscreenSurface {
|
||||
pub surface: CosmicSurface,
|
||||
|
|
@ -222,6 +232,7 @@ impl Workspace {
|
|||
tiling_layer,
|
||||
floating_layer,
|
||||
tiling_enabled,
|
||||
minimized_windows: Vec::new(),
|
||||
fullscreen: None,
|
||||
handle,
|
||||
focus_stack: FocusStacks::default(),
|
||||
|
|
|
|||
|
|
@ -162,6 +162,17 @@ impl XdgShellHandler for State {
|
|||
Shell::resize_request(self, surface.wl_surface(), &seat, serial, edges.into())
|
||||
}
|
||||
|
||||
fn minimize_request(&mut self, surface: ToplevelSurface) {
|
||||
if let Some(mapped) = self
|
||||
.common
|
||||
.shell
|
||||
.element_for_wl_surface(surface.wl_surface())
|
||||
.cloned()
|
||||
{
|
||||
self.common.shell.minimize_request(&mapped)
|
||||
}
|
||||
}
|
||||
|
||||
fn maximize_request(&mut self, surface: ToplevelSurface) {
|
||||
if let Some(mapped) = self
|
||||
.common
|
||||
|
|
|
|||
|
|
@ -426,6 +426,20 @@ impl XwmHandler for State {
|
|||
}
|
||||
}
|
||||
|
||||
fn minimize_request(&mut self, _xwm: XwmId, window: X11Surface) {
|
||||
let surface = CosmicSurface::X11(window);
|
||||
if let Some(mapped) = self.common.shell.element_for_surface(&surface).cloned() {
|
||||
self.common.shell.minimize_request(&mapped);
|
||||
}
|
||||
}
|
||||
|
||||
fn unminimize_request(&mut self, _xwm: XwmId, window: X11Surface) {
|
||||
let surface = CosmicSurface::X11(window);
|
||||
if let Some(mapped) = self.common.shell.element_for_surface(&surface).cloned() {
|
||||
self.common.shell.unminimize_request(&mapped);
|
||||
}
|
||||
}
|
||||
|
||||
fn fullscreen_request(&mut self, _xwm: XwmId, window: X11Surface) {
|
||||
if let Some(mapped) = self.common.shell.element_for_x11_surface(&window).cloned() {
|
||||
if let Some(workspace) = self.common.shell.space_for_mut(&mapped) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue