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

xwayland: add xdg-toplevel listener


So that when running rootful, the compositor can close the Xwayland
window using the xdg-toplevel protocol.

Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 7a517f39
No related branches found
No related tags found
No related merge requests found
......@@ -540,6 +540,28 @@ static const struct wl_surface_listener surface_listener = {
xwl_window_surface_leave
};
static void
xdg_toplevel_handle_configure(void *data,
struct xdg_toplevel *xdg_toplevel,
int32_t width,
int32_t height,
struct wl_array *states)
{
}
static void
xdg_toplevel_handle_close(void *data,
struct xdg_toplevel *xdg_toplevel)
{
DebugF("Terminating on compositor request");
GiveUp(0);
}
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
xdg_toplevel_handle_configure,
xdg_toplevel_handle_close,
};
static Bool
xwl_create_root_surface(struct xwl_window *xwl_window)
{
......@@ -567,6 +589,10 @@ xwl_create_root_surface(struct xwl_window *xwl_window)
xdg_surface_add_listener(xwl_window->xdg_surface,
&xdg_surface_listener, xwl_window);
xdg_toplevel_add_listener(xwl_window->xdg_toplevel,
&xdg_toplevel_listener,
NULL);
xwl_window_rootful_update_title(xwl_window);
wl_surface_commit(xwl_window->surface);
......
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