From a0ed3b4685a87fd6904c35c558f55dfe57f48a8f Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Thu, 12 Mar 2026 23:15:25 -0400 Subject: [PATCH] get rid of popup --- .../app/src/main/cpp/xemu_notifications_stub.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/cpp/xemu_notifications_stub.c b/android/app/src/main/cpp/xemu_notifications_stub.c index 01a7e651c7..8fb6198543 100644 --- a/android/app/src/main/cpp/xemu_notifications_stub.c +++ b/android/app/src/main/cpp/xemu_notifications_stub.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -49,11 +50,23 @@ static void xemu_android_show_toast(const char *msg, int duration) (*env)->DeleteLocalRef(env, activity_class); } +static int xemu_android_should_suppress_toast(const char *msg) +{ + if (!msg) { + return 0; + } + + return strncmp(msg, "Connected '", 11) == 0 && + strstr(msg, "' to port ") != NULL; +} + void xemu_queue_notification(const char *msg) { if (msg) { fprintf(stderr, "[xemu] %s\n", msg); - xemu_android_show_toast(msg, 0); + if (!xemu_android_should_suppress_toast(msg)) { + xemu_android_show_toast(msg, 0); + } } }