state: Correctly update primary output
This commit is contained in:
parent
ddcb435632
commit
eea93d543e
2 changed files with 67 additions and 49 deletions
|
|
@ -1199,6 +1199,11 @@ impl SurfaceThreadState {
|
|||
}
|
||||
}
|
||||
|
||||
if self.mirroring.is_none() {
|
||||
let states = frame_result.states;
|
||||
self.send_dmabuf_feedback(states);
|
||||
}
|
||||
|
||||
if x.is_ok() {
|
||||
let new_state = QueueState::WaitingForVBlank {
|
||||
redraw_needed: false,
|
||||
|
|
@ -1218,13 +1223,9 @@ impl SurfaceThreadState {
|
|||
|
||||
if self.mirroring.is_none() {
|
||||
self.frame_callback_seq = self.frame_callback_seq.wrapping_add(1);
|
||||
|
||||
let states = frame_result.states;
|
||||
self.send_frame_callbacks();
|
||||
self.send_dmabuf_feedback(states);
|
||||
}
|
||||
} else {
|
||||
tracing::debug!("Stopped rendering");
|
||||
self.queue_estimated_vblank(estimated_presentation);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
107
src/state.rs
107
src/state.rs
|
|
@ -608,14 +608,8 @@ impl Common {
|
|||
}
|
||||
|
||||
// sticky window
|
||||
shell
|
||||
.workspaces
|
||||
.sets
|
||||
.get(output)
|
||||
.unwrap()
|
||||
.sticky_layer
|
||||
.mapped()
|
||||
.for_each(|mapped| {
|
||||
for set in shell.workspaces.sets.values() {
|
||||
set.sticky_layer.mapped().for_each(|mapped| {
|
||||
for (window, _) in mapped.windows() {
|
||||
window.with_surfaces(|surface, states| {
|
||||
let primary_scanout_output = update_surface_primary_scanout_output(
|
||||
|
|
@ -634,28 +628,49 @@ impl Common {
|
|||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// normal windows
|
||||
let active = shell.active_space(output);
|
||||
active.mapped().for_each(|mapped| {
|
||||
for (window, _) in mapped.windows() {
|
||||
window.with_surfaces(|surface, states| {
|
||||
let primary_scanout_output = update_surface_primary_scanout_output(
|
||||
surface,
|
||||
output,
|
||||
states,
|
||||
render_element_states,
|
||||
default_primary_scanout_output_compare,
|
||||
);
|
||||
if let Some(output) = primary_scanout_output {
|
||||
with_fractional_scale(states, |fraction_scale| {
|
||||
fraction_scale
|
||||
.set_preferred_scale(output.current_scale().fractional_scale());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
for space in shell.workspaces.spaces() {
|
||||
space.mapped().for_each(|mapped| {
|
||||
for (window, _) in mapped.windows() {
|
||||
window.with_surfaces(|surface, states| {
|
||||
let primary_scanout_output = update_surface_primary_scanout_output(
|
||||
surface,
|
||||
output,
|
||||
states,
|
||||
render_element_states,
|
||||
default_primary_scanout_output_compare,
|
||||
);
|
||||
if let Some(output) = primary_scanout_output {
|
||||
with_fractional_scale(states, |fraction_scale| {
|
||||
fraction_scale
|
||||
.set_preferred_scale(output.current_scale().fractional_scale());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
space.minimized_windows.iter().for_each(|m| {
|
||||
for (window, _) in m.window.windows() {
|
||||
window.with_surfaces(|surface, states| {
|
||||
let primary_scanout_output = update_surface_primary_scanout_output(
|
||||
surface,
|
||||
output,
|
||||
states,
|
||||
render_element_states,
|
||||
default_primary_scanout_output_compare,
|
||||
);
|
||||
if let Some(output) = primary_scanout_output {
|
||||
with_fractional_scale(states, |fraction_scale| {
|
||||
fraction_scale
|
||||
.set_preferred_scale(output.current_scale().fractional_scale());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// OR windows
|
||||
shell.override_redirect_windows.iter().for_each(|or| {
|
||||
|
|
@ -679,23 +694,25 @@ impl Common {
|
|||
});
|
||||
|
||||
// layer surfaces
|
||||
let map = smithay::desktop::layer_map_for_output(output);
|
||||
for layer_surface in map.layers() {
|
||||
layer_surface.with_surfaces(|surface, states| {
|
||||
let primary_scanout_output = update_surface_primary_scanout_output(
|
||||
surface,
|
||||
output,
|
||||
states,
|
||||
render_element_states,
|
||||
default_primary_scanout_output_compare,
|
||||
);
|
||||
if let Some(output) = primary_scanout_output {
|
||||
with_fractional_scale(states, |fraction_scale| {
|
||||
fraction_scale
|
||||
.set_preferred_scale(output.current_scale().fractional_scale());
|
||||
});
|
||||
}
|
||||
});
|
||||
for o in shell.outputs() {
|
||||
let map = smithay::desktop::layer_map_for_output(o);
|
||||
for layer_surface in map.layers() {
|
||||
layer_surface.with_surfaces(|surface, states| {
|
||||
let primary_scanout_output = update_surface_primary_scanout_output(
|
||||
surface,
|
||||
output,
|
||||
states,
|
||||
render_element_states,
|
||||
default_primary_scanout_output_compare,
|
||||
);
|
||||
if let Some(output) = primary_scanout_output {
|
||||
with_fractional_scale(states, |fraction_scale| {
|
||||
fraction_scale
|
||||
.set_preferred_scale(output.current_scale().fractional_scale());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue