xwayland: set the app_id and install a desktop launcher

The app_id is used to identify applications (and group windows), some
desktops (such as GNOME Shell) use it in their top bar.

Set the XDG toplevel "app_id" to "org.freedesktop.Xwayland" and install
a desktop file for Xwayland rootful.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Olivier Fourdan 2022-04-29 10:22:15 +02:00
parent f31f059934
commit 41f3419fee
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Name=Xwayland
Comment=A rootful instance of the Xwayland X11 server
Terminal=false
Type=Application
Categories=System;
NoDisplay=true

View File

@ -173,3 +173,7 @@ xwayland_manpage = configure_file(
configuration: manpage_config, configuration: manpage_config,
) )
install_man(xwayland_manpage) install_man(xwayland_manpage)
datadir = join_paths(get_option('prefix'), get_option('datadir'))
desktopdir = join_paths(datadir, 'applications')
install_data('desktop/org.freedesktop.Xwayland.desktop', install_dir : desktopdir)

View File

@ -489,6 +489,15 @@ xwl_window_rootful_update_title(struct xwl_window *xwl_window)
xdg_toplevel_set_title(xwl_window->xdg_toplevel, title); xdg_toplevel_set_title(xwl_window->xdg_toplevel, title);
} }
static void
xwl_window_rootful_set_app_id(struct xwl_window *xwl_window)
{
const char *app_id = "org.freedesktop.Xwayland";
if (xwl_window->xdg_toplevel)
xdg_toplevel_set_app_id(xwl_window->xdg_toplevel, app_id);
}
static void static void
xdg_surface_handle_configure(void *data, xdg_surface_handle_configure(void *data,
struct xdg_surface *xdg_surface, struct xdg_surface *xdg_surface,
@ -594,6 +603,7 @@ xwl_create_root_surface(struct xwl_window *xwl_window)
NULL); NULL);
xwl_window_rootful_update_title(xwl_window); xwl_window_rootful_update_title(xwl_window);
xwl_window_rootful_set_app_id(xwl_window);
wl_surface_commit(xwl_window->surface); wl_surface_commit(xwl_window->surface);