feat: support multiple fullscreen windows per workspace
This commit is contained in:
parent
9f28a764a7
commit
28ef6bdbc8
12 changed files with 381 additions and 308 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue