Skip to content
Snippets Groups Projects
Commit c7a50db7 authored by Olivier Fourdan's avatar Olivier Fourdan :tools:
Browse files

xwayland: keep track of the wl_output enter/leave


Keep track of the output the surface enters/leaves.

This is fairly basic tracking though, we do not keep a full list of
outputs a surface may be covering partially, we just keep the output
the surface entered last.

This is sufficient as a preparation work for fullscreen though.

Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent f80bf834
No related branches found
No related tags found
No related merge requests found
......@@ -413,6 +413,33 @@ static const struct xdg_surface_listener xdg_surface_listener = {
xdg_surface_handle_configure,
};
static void
xwl_window_surface_enter(void *data,
struct wl_surface *wl_surface,
struct wl_output *wl_output)
{
struct xwl_window *xwl_window = data;
if (xwl_window->wl_output != wl_output)
xwl_window->wl_output = wl_output;
}
static void
xwl_window_surface_leave(void *data,
struct wl_surface *wl_surface,
struct wl_output *wl_output)
{
struct xwl_window *xwl_window = data;
if (xwl_window->wl_output == wl_output)
xwl_window->wl_output = NULL;
}
static const struct wl_surface_listener surface_listener = {
xwl_window_surface_enter,
xwl_window_surface_leave
};
static Bool
ensure_surface_for_window(WindowPtr window)
{
......@@ -456,6 +483,9 @@ ensure_surface_for_window(WindowPtr window)
goto err_surf;
}
wl_surface_add_listener(xwl_window->surface,
&surface_listener, xwl_window);
xdg_surface_add_listener(xwl_window->xdg_surface,
&xdg_surface_listener, xwl_window);
......
......@@ -51,6 +51,7 @@ struct xwl_window {
struct xorg_list window_buffers_available;
struct xorg_list window_buffers_unavailable;
OsTimerPtr window_buffers_timer;
struct wl_output *wl_output;
#ifdef GLAMOR_HAS_GBM
struct xorg_list frame_callback_list;
Bool present_flipped;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment