scene: add primary output to wlr_scene_surface

This allows compositors to avoid sending multiple frame done events
to a surface that is rendered on multiple outputs at once. This may
also be used in the same way for presentation feedback.
This commit is contained in:
Isaac Freund 2021-12-11 12:25:53 +01:00 committed by Simon Ser
parent 0215dffba5
commit fb1f613510
2 changed files with 19 additions and 2 deletions

View file

@ -74,6 +74,14 @@ struct wlr_scene_surface {
struct wlr_scene_node node;
struct wlr_surface *surface;
/**
* The output that the largest area of this surface is displayed on.
* This may be NULL if the surface is not currently displayed on any
* outputs. This is the output that should be used for frame callbacks,
* presentation feedback, etc.
*/
struct wlr_output *primary_output;
// private state
int prev_width, prev_height;