From 11f6f8d63a90d9661570ce389c92f23d8d421cc4 Mon Sep 17 00:00:00 2001 From: Wateir Date: Mon, 13 Apr 2026 16:27:12 +0200 Subject: [PATCH 1/2] fix : ensure the current dekstop is mango before executing ipc dispatch --- mmsg/mmsg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mmsg/mmsg.c b/mmsg/mmsg.c index 69f1d1d0..f400701c 100644 --- a/mmsg/mmsg.c +++ b/mmsg/mmsg.c @@ -546,6 +546,15 @@ static void usage(void) { } int32_t main(int32_t argc, char *argv[]) { + + const char *env_XDG_DEKSTOP = getenv("XDG_CURRENT_DESKTOP"); + + if (!env_XDG_DEKSTOP || strcmp(env_XDG_DEKSTOP, "mango")) { + fprintf(stderr, "wrong dekstop, wanted 'mango' have '%s'\n", + env_XDG_DEKSTOP); + exit(EXIT_FAILURE); + } + ARGBEGIN { case 'q': qflag = 1; From e35f4939de94b5a9a9557db550f39e431b671e8c Mon Sep 17 00:00:00 2001 From: Wateir Date: Mon, 13 Apr 2026 18:55:33 +0200 Subject: [PATCH 2/2] feat : take into account that it can be more than just 'mango' --- mmsg/mmsg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mmsg/mmsg.c b/mmsg/mmsg.c index f400701c..a9a374ce 100644 --- a/mmsg/mmsg.c +++ b/mmsg/mmsg.c @@ -549,7 +549,11 @@ int32_t main(int32_t argc, char *argv[]) { const char *env_XDG_DEKSTOP = getenv("XDG_CURRENT_DESKTOP"); - if (!env_XDG_DEKSTOP || strcmp(env_XDG_DEKSTOP, "mango")) { + /* + * https://specifications.freedesktop.org/mime-apps/latest/file.html + * can be more than just 'mango' but 'mango,mangowm,wlroots' + */ + if (!env_XDG_DEKSTOP || !strstr(env_XDG_DEKSTOP, "mango")) { fprintf(stderr, "wrong dekstop, wanted 'mango' have '%s'\n", env_XDG_DEKSTOP); exit(EXIT_FAILURE);