Skip to content

Commit

Permalink
Update primary scanout output when not visible on previous output
Browse files Browse the repository at this point in the history
This seems to fix pop-os/cosmic-comp#58.
Though in the future the default behavior in Smithay may need some
improvement.
  • Loading branch information
ids1024 committed Mar 10, 2023
1 parent dd9b012 commit 93c9be9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,27 @@ impl Common {

let active = self.shell.active_space(output);
active.mapped().for_each(|mapped| {
if active.outputs_for_element(mapped).any(|o| &o == output) {
let outputs_for_element: Vec<_> = active.outputs_for_element(mapped).collect();
if outputs_for_element.contains(&output) {
let window = mapped.active_window();
window.with_surfaces(|surface, states| {
update_surface_primary_scanout_output(
surface,
output,
states,
render_element_states,
default_primary_scanout_output_compare,
|current_output, current_state, next_output, next_state| {
if outputs_for_element.contains(current_output) {
default_primary_scanout_output_compare(
current_output,
current_state,
next_output,
next_state,
)
} else {
next_output
}
},
);
});
window.send_frame(output, time, throttle, surface_primary_scanout_output);
Expand Down

0 comments on commit 93c9be9

Please sign in to comment.