shell: handle fullscreen windows on a dedicated layer

I hoped to split this up into multiple commits, but the api
changes to `shell/workspace.rs` were to invasive to feasibly do this.

Here is a rough list of changes:

- Fullscreen windows aren't mapped to other layers anymore
  - This they need their own logic for:
    - Sending frames
    - Dmabuf Feedback
    - Primary outputs
    - On commit handlers
    - cursor tests
  - They get their own unmap/remap logic
  - They get a new restore state similar to minimized windows
    - Refactored the minimized window state to reuse as much as possible
      here
  - They need to be part of focus stacks, which means adjusting them
    to a new type `FocusTarget` as they previously only handled
    `CosmicMapped`.
  - Various shell handlers (minimize, move, menu) now have dedicated
    logic for fullscreen surfaces
    - This was partially necessary due to relying on CosmicSurface now,
      partially because they should've had their own logic from the
      start. E.g. the context menu is now reflecting the fullscreen
      state
- Fullscreen windows may be rendered behind other windows now, when they
  loose focus.
  - This needed changes to input handling / rendering
This commit is contained in:
Victoria Brekenfeld 2025-06-25 17:54:27 +02:00 committed by Victoria Brekenfeld
parent 8ef6c161a0
commit adedb705e7
23 changed files with 2554 additions and 1796 deletions

View file

@ -16,7 +16,7 @@ use crate::{
config::ScreenFilter,
shell::{
element::CosmicMappedKey,
focus::{render_input_order, target::WindowGroup, Stage},
focus::{render_input_order, target::WindowGroup, FocusTarget, Stage},
grabs::{SeatMenuGrabState, SeatMoveGrabState},
layout::tiling::ANIMATION_DURATION,
zoom::ZoomState,
@ -897,7 +897,12 @@ where
layout
.render(
renderer,
current_focus.as_ref().and_then(|stack| stack.last()),
current_focus.as_ref().and_then(|stack| {
stack.last().and_then(|t| match t {
FocusTarget::Window(w) => Some(w),
_ => None,
})
}),
resize_indicator.clone(),
active_hint,
alpha,
@ -913,7 +918,8 @@ where
elements.extend(
match workspace.render_popups(
renderer,
(!move_active && is_active_space).then_some(last_active_seat),
last_active_seat,
!move_active && is_active_space,
overview.clone(),
&theme.cosmic(),
) {
@ -941,7 +947,8 @@ where
elements.extend(
match workspace.render(
renderer,
(!move_active && is_active_space).then_some(last_active_seat),
last_active_seat,
!move_active && is_active_space,
overview.clone(),
resize_indicator.clone(),
active_hint,