output: Tie the output to the monitor it's part of

Outputs correspond to active connectors, that we translate into
monitors. Make this association more real by adding a pointer back to
the monitor from the output.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
This commit is contained in:
Jonas Ådahl
2020-10-08 17:34:57 +02:00
committed by Marge Bot
parent 5edc118d62
commit 7215b0d88c
4 changed files with 35 additions and 0 deletions

View File

@ -45,6 +45,8 @@ typedef struct _MetaOutputPrivate
MetaOutputInfo *info;
MetaMonitor *monitor;
/* The CRTC driving this output, NULL if the output is not enabled */
MetaCrtc *crtc;
@ -112,6 +114,27 @@ meta_output_get_gpu (MetaOutput *output)
return priv->gpu;
}
MetaMonitor *
meta_output_get_monitor (MetaOutput *output)
{
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
g_warn_if_fail (priv->monitor);
return priv->monitor;
}
void
meta_output_set_monitor (MetaOutput *output,
MetaMonitor *monitor)
{
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
g_warn_if_fail (!priv->monitor);
priv->monitor = monitor;
}
const char *
meta_output_get_name (MetaOutput *output)
{