Skip to content

Commit

Permalink
Merge pull request #88 from pop-os/primary-scanout_jammy
Browse files Browse the repository at this point in the history
Update primary scanout output when not visible on previous output
  • Loading branch information
Drakulix authored Mar 10, 2023
2 parents dd9b012 + 93c9be9 commit 8a188cb
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 8a188cb

Please sign in to comment.