mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-26 07:58:20 -04:00
scene: keep last preferred configuration when leaving last output
Before this patch, when a surface became occluded on all outputs, we'd reconfigure it with a base configuration (scale set to 1, transform set to NORMAL, image description set to gamma 2.2/sRGB). As a result, when quickly hiding a toplevel and showing it again, the client would render to switch to the base configuration, then render again to switch to the output configuration. Avoi this needless back-and-forth by retaining the last sent preferred configuration when a surface leaves all outputs.
This commit is contained in:
parent
ca8b49d858
commit
3f9a164484
1 changed files with 6 additions and 0 deletions
|
|
@ -96,6 +96,12 @@ static void handle_scene_buffer_outputs_update(
|
||||||
|
|
||||||
surface->frame_pacing_output = get_surface_frame_pacing_output(surface->surface);
|
surface->frame_pacing_output = get_surface_frame_pacing_output(surface->surface);
|
||||||
|
|
||||||
|
// If the surface is no longer visible on any output, keep the last sent
|
||||||
|
// preferred configuration to avoid unnecessary redraws
|
||||||
|
if (wl_list_empty(&surface->surface->current_outputs)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double scale = get_surface_preferred_buffer_scale(surface->surface);
|
double scale = get_surface_preferred_buffer_scale(surface->surface);
|
||||||
wlr_fractional_scale_v1_notify_scale(surface->surface, scale);
|
wlr_fractional_scale_v1_notify_scale(surface->surface, scale);
|
||||||
wlr_surface_set_preferred_buffer_scale(surface->surface, ceil(scale));
|
wlr_surface_set_preferred_buffer_scale(surface->surface, ceil(scale));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue