Skip to content
Open
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
13 changes: 11 additions & 2 deletions src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ pub struct PendingWindow {
pub surface: CosmicSurface,
pub seat: Seat<State>,
pub fullscreen: Option<Output>,
pub minimized: bool,
pub maximized: bool,
pub sticky: bool,
}
Expand Down Expand Up @@ -2828,6 +2829,7 @@ impl Shell {
surface: window,
seat,
fullscreen: output,
minimized: should_be_minimized,
maximized: should_be_maximized,
sticky: mut should_be_sticky,
} = self.pending_windows.remove(pos);
Expand Down Expand Up @@ -2911,6 +2913,7 @@ impl Shell {
if let Some(FocusTarget::Window(focused)) = maybe_focused
&& let Some(stack) = focused.stack_ref()
&& !is_dialog
&& !should_be_minimized
&& !should_be_maximized
&& !(workspace.is_tiled(&focused.active_window()) && floating_exception)
{
Expand Down Expand Up @@ -2960,8 +2963,13 @@ impl Shell {
self.maximize_request(&mapped, &seat, false, loop_handle);
}

let new_target = if (workspace_output == seat.active_output()
&& active_handle == workspace_handle)
if should_be_minimized {
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
{
// TODO: enforce focus stealing prevention by also checking the same rules as for the else case.
Expand Down Expand Up @@ -3085,6 +3093,7 @@ impl Shell {
surface,
seat: seat.clone(),
fullscreen: None,
minimized: false,
maximized: false,
sticky: false,
});
Expand Down
1 change: 1 addition & 0 deletions src/wayland/handlers/xdg_shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl XdgShellHandler for State {
surface,
seat,
fullscreen: None,
minimized: false,
maximized: false,
sticky: false,
})
Expand Down
3 changes: 3 additions & 0 deletions src/xwayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ impl XwmHandler for State {
);
}
let fullscreen = window.is_fullscreen().then(|| seat.active_output());
let minimized = window.is_hidden();
let maximized = window.is_maximized();
if let Some(pending) = shell
.pending_windows
Expand All @@ -816,13 +817,15 @@ impl XwmHandler for State {
{
pending.seat = seat;
pending.fullscreen = fullscreen;
pending.minimized = minimized;
pending.maximized = maximized;
} else {
let surface = CosmicSurface::from(window);
shell.pending_windows.push(PendingWindow {
surface,
seat,
fullscreen,
minimized,
maximized,
sticky: false,
})
Expand Down
Loading