feat: support multiple fullscreen windows per workspace

This commit is contained in:
Hojjat Abdollahi 2026-06-02 09:48:33 -06:00 committed by GitHub
parent 9f28a764a7
commit 28ef6bdbc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 381 additions and 308 deletions

View file

@ -1024,14 +1024,18 @@ impl SurfaceThreadState {
let animations_going = shell.animations_going();
let output = self.mirroring.as_ref().unwrap_or(&self.output);
if let Some((_, workspace)) = shell.workspaces.active(output) {
if let Some(fullscreen_surface) = workspace.get_fullscreen() {
let seat = shell.seats.last_active();
if let Some(fullscreen_surface) = workspace.get_fullscreen(seat) {
const _30_FPS: Duration = Duration::from_nanos(1_000_000_000 / 30);
(
true,
fullscreen_surface.wl_surface().is_some_and(|surface| {
recursive_frame_time_estimation(&self.clock, &surface)
.is_some_and(|dur| dur <= _30_FPS)
}),
fullscreen_surface
.surface
.wl_surface()
.is_some_and(|surface| {
recursive_frame_time_estimation(&self.clock, &surface)
.is_some_and(|dur| dur <= _30_FPS)
}),
animations_going,
)
} else {
@ -1490,18 +1494,21 @@ fn render_node_for_output(
let Some(workspace) = shell.active_space(output) else {
return *target_node;
};
let nodes = workspace
.get_fullscreen()
.map(|w| vec![w.clone()])
.unwrap_or_else(|| {
workspace
.mapped()
.map(|mapped| mapped.active_window())
.collect::<Vec<_>>()
})
.into_iter()
.flat_map(|w| w.wl_surface().and_then(|s| source_node_for_surface(&s)))
.collect::<Vec<_>>();
let fullscreens: Vec<_> = workspace
.get_fullscreen_surfaces()
.map(|f| f.surface.clone())
.collect();
let nodes = if !fullscreens.is_empty() {
fullscreens
} else {
workspace
.mapped()
.map(|mapped| mapped.active_window())
.collect::<Vec<_>>()
}
.into_iter()
.flat_map(|w| w.wl_surface().and_then(|s| source_node_for_surface(&s)))
.collect::<Vec<_>>();
if nodes.contains(target_node) || nodes.is_empty() {
*target_node