xwayland: Add API to send signal to the Xwayland process

Will be used for test cases to fake-crash the Xwayland process.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2364>
This commit is contained in:
Jonas Ådahl 2022-04-05 23:46:42 +02:00 committed by Marge Bot
parent bdb34401c5
commit c9e7cf4ea1
2 changed files with 21 additions and 0 deletions

View File

@ -1276,3 +1276,19 @@ meta_xwayland_handle_xevent (XEvent *event)
return FALSE;
}
gboolean
meta_xwayland_signal (MetaXWaylandManager *manager,
int signum,
GError **error)
{
if (!manager->proc)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Can't send signal, Xwayland not running");
return FALSE;
}
g_subprocess_send_signal (manager->proc, signum);
return TRUE;
}

View File

@ -50,4 +50,9 @@ void
meta_xwayland_associate_window_with_surface (MetaWindow *window,
MetaWaylandSurface *surface);
META_EXPORT_TEST
gboolean meta_xwayland_signal (MetaXWaylandManager *manager,
int signum,
GError **error);
#endif /* META_XWAYLAND_H */