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