[mutter/wip/carlosg/frames-client: 12/12] core: Add fallback location for the mutter-x11-frames executable
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/frames-client: 12/12] core: Add fallback location for the mutter-x11-frames executable
- Date: Sat, 17 Sep 2022 08:41:24 +0000 (UTC)
commit 0224ab515d99fa71ccd6055ec489df5b97c900e2
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Sep 17 10:28:41 2022 +0200
core: Add fallback location for the mutter-x11-frames executable
Typically this will be installed in libexecdir and run from there, but
this requires "ninja install" before "ninja test", which is not ideal.
Add a fallback specific to the situation of meson tests, so that the
frames client is executed from the builddir instead. In order to
avoid disk seeks checking for file existence, and envvars to tweak
Mutter behavior, this is only done as a last resort, the installed
executable in libexecdir is still preferred.
src/core/frame.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/core/frame.c b/src/core/frame.c
index 132e71227e..6ddc4db220 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -534,8 +534,21 @@ on_x11_display_setup (MetaDisplay *display,
proc = g_subprocess_launcher_spawnv (launcher, args, &error);
if (error)
{
- g_warning ("Could not launch X11 frames client: %s", error->message);
- return;
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
+ {
+ /* Fallback case for uninstalled tests, relies on CWD being
+ * the builddir, as it is the case during "ninja test".
+ */
+ g_clear_error (&error);
+ args[0] = "./src/frames/mutter-x11-frames";
+ proc = g_subprocess_launcher_spawnv (launcher, args, &error);
+ }
+
+ if (error)
+ {
+ g_warning ("Could not launch X11 frames client: %s", error->message);
+ return;
+ }
}
g_subprocess_wait_async (proc, NULL, on_frames_died, display);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]