xwayland: add xwl_output_from_wl_output()

Add a convenient function to get the xwl_output from a given wl_output.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Olivier Fourdan 2022-05-12 11:53:18 +02:00
parent b0cee5e703
commit f80bf83465
2 changed files with 17 additions and 0 deletions

View File

@ -752,6 +752,20 @@ xwl_output_set_emulated(struct xwl_output *xwl_output)
&val, FALSE, FALSE);
}
struct xwl_output*
xwl_output_from_wl_output(struct xwl_screen *xwl_screen,
struct wl_output* wl_output)
{
struct xwl_output *xwl_output;
xorg_list_for_each_entry(xwl_output, &xwl_screen->output_list, link) {
if (xwl_output->output == wl_output)
return xwl_output;
}
return NULL;
}
struct xwl_output *
xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id, Bool with_xrandr)
{

View File

@ -79,6 +79,9 @@ Bool xwl_screen_init_randr_fixed(struct xwl_screen *xwl_screen);
void xwl_output_set_mode_fixed(struct xwl_output *xwl_output,
RRModePtr mode);
struct xwl_output *xwl_output_from_wl_output(struct xwl_screen *xwl_screen,
struct wl_output* wl_output);
struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen,
uint32_t id, Bool with_xrandr);