diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2022-04-05 23:46:42 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2022-06-01 14:55:24 +0200 |
commit | 573eae6ebc85b4f69cff215608b9a16f6a1592f6 (patch) | |
tree | cab682a66a5d108c1d3aa3f14e2bcd85dbdfa63b | |
parent | df8d0631ee343e6cd8e7fd52c90041b57a1b6c19 (diff) | |
download | mutter-573eae6ebc85b4f69cff215608b9a16f6a1592f6.tar.gz |
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>
-rw-r--r-- | src/wayland/meta-xwayland.c | 16 | ||||
-rw-r--r-- | src/wayland/meta-xwayland.h | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 4bf45f3dc..9b61ce569 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -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; +} diff --git a/src/wayland/meta-xwayland.h b/src/wayland/meta-xwayland.h index dac9c689f..cbe27b183 100644 --- a/src/wayland/meta-xwayland.h +++ b/src/wayland/meta-xwayland.h @@ -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 */ |