feat: allow XWayland window to start minimized
This commit is contained in:
parent
5c93094574
commit
94178034dd
3 changed files with 15 additions and 2 deletions
|
|
@ -254,6 +254,7 @@ pub struct PendingWindow {
|
||||||
pub surface: CosmicSurface,
|
pub surface: CosmicSurface,
|
||||||
pub seat: Seat<State>,
|
pub seat: Seat<State>,
|
||||||
pub fullscreen: Option<Output>,
|
pub fullscreen: Option<Output>,
|
||||||
|
pub minimized: bool,
|
||||||
pub maximized: bool,
|
pub maximized: bool,
|
||||||
pub sticky: bool,
|
pub sticky: bool,
|
||||||
}
|
}
|
||||||
|
|
@ -2856,6 +2857,7 @@ impl Shell {
|
||||||
surface: window,
|
surface: window,
|
||||||
seat,
|
seat,
|
||||||
fullscreen: output,
|
fullscreen: output,
|
||||||
|
minimized: should_be_minimized,
|
||||||
maximized: should_be_maximized,
|
maximized: should_be_maximized,
|
||||||
sticky: mut should_be_sticky,
|
sticky: mut should_be_sticky,
|
||||||
} = self.pending_windows.remove(pos);
|
} = self.pending_windows.remove(pos);
|
||||||
|
|
@ -2939,6 +2941,7 @@ impl Shell {
|
||||||
if let Some(FocusTarget::Window(focused)) = maybe_focused
|
if let Some(FocusTarget::Window(focused)) = maybe_focused
|
||||||
&& let Some(stack) = focused.stack_ref()
|
&& let Some(stack) = focused.stack_ref()
|
||||||
&& !is_dialog
|
&& !is_dialog
|
||||||
|
&& !should_be_minimized
|
||||||
&& !should_be_maximized
|
&& !should_be_maximized
|
||||||
&& !(workspace.is_tiled(&focused.active_window()) && floating_exception)
|
&& !(workspace.is_tiled(&focused.active_window()) && floating_exception)
|
||||||
{
|
{
|
||||||
|
|
@ -2988,8 +2991,13 @@ impl Shell {
|
||||||
self.maximize_request(&mapped, &seat, false, loop_handle);
|
self.maximize_request(&mapped, &seat, false, loop_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
let new_target = if (workspace_output == seat.active_output()
|
if should_be_minimized {
|
||||||
&& active_handle == workspace_handle)
|
self.minimize_request(&window);
|
||||||
|
}
|
||||||
|
|
||||||
|
let new_target = if should_be_minimized {
|
||||||
|
None
|
||||||
|
} else if (workspace_output == seat.active_output() && active_handle == workspace_handle)
|
||||||
|| should_be_sticky
|
|| should_be_sticky
|
||||||
{
|
{
|
||||||
// TODO: enforce focus stealing prevention by also checking the same rules as for the else case.
|
// TODO: enforce focus stealing prevention by also checking the same rules as for the else case.
|
||||||
|
|
@ -3113,6 +3121,7 @@ impl Shell {
|
||||||
surface,
|
surface,
|
||||||
seat: seat.clone(),
|
seat: seat.clone(),
|
||||||
fullscreen: None,
|
fullscreen: None,
|
||||||
|
minimized: false,
|
||||||
maximized: false,
|
maximized: false,
|
||||||
sticky: false,
|
sticky: false,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ impl XdgShellHandler for State {
|
||||||
surface,
|
surface,
|
||||||
seat,
|
seat,
|
||||||
fullscreen: None,
|
fullscreen: None,
|
||||||
|
minimized: false,
|
||||||
maximized: false,
|
maximized: false,
|
||||||
sticky: false,
|
sticky: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -808,6 +808,7 @@ impl XwmHandler for State {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let fullscreen = window.is_fullscreen().then(|| seat.active_output());
|
let fullscreen = window.is_fullscreen().then(|| seat.active_output());
|
||||||
|
let minimized = window.is_hidden();
|
||||||
let maximized = window.is_maximized();
|
let maximized = window.is_maximized();
|
||||||
if let Some(pending) = shell
|
if let Some(pending) = shell
|
||||||
.pending_windows
|
.pending_windows
|
||||||
|
|
@ -816,6 +817,7 @@ impl XwmHandler for State {
|
||||||
{
|
{
|
||||||
pending.seat = seat;
|
pending.seat = seat;
|
||||||
pending.fullscreen = fullscreen;
|
pending.fullscreen = fullscreen;
|
||||||
|
pending.minimized = minimized;
|
||||||
pending.maximized = maximized;
|
pending.maximized = maximized;
|
||||||
} else {
|
} else {
|
||||||
let surface = CosmicSurface::from(window);
|
let surface = CosmicSurface::from(window);
|
||||||
|
|
@ -823,6 +825,7 @@ impl XwmHandler for State {
|
||||||
surface,
|
surface,
|
||||||
seat,
|
seat,
|
||||||
fullscreen,
|
fullscreen,
|
||||||
|
minimized,
|
||||||
maximized,
|
maximized,
|
||||||
sticky: false,
|
sticky: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue