Compare commits

..
4 Commits
4 changed files with 38 additions and 10 deletions
+1 -1
View File
@@ -35,7 +35,7 @@
</screenshots> </screenshots>
<releases> <releases>
<release version="0.1.0" date="2026-02-28"> <release version="0.1.0" date="2026-03-01">
<description> <description>
<p>Initial release.</p> <p>Initial release.</p>
</description> </description>
+3 -4
View File
@@ -16,10 +16,9 @@
"buildsystem": "meson", "buildsystem": "meson",
"sources": [ "sources": [
{ {
"type": "git", "type": "archive",
"url": "https://gitea.angeltech.jp/Angel-Technologies/MoeMoji", "url": "https://gitea.angeltech.jp/Angel-Technologies/MoeMoji/archive/v0.1.3.tar.gz",
"tag": "v0.1.1", "sha256": "b3942dfa69c85dade533e3db5bb26bf82bf165ae396038de9f9038e8a7e63a8a"
"commit": "9106ecc1aee48a985900ff26cccf910cdb02e93e"
} }
] ]
} }
+33 -5
View File
@@ -93,10 +93,13 @@ static void toggle_window(MoeMojiApplication *self) {
} }
} }
static gboolean on_close_request(GtkWindow *window, static gboolean on_close_request(GtkWindow *window, gpointer user_data) {
G_GNUC_UNUSED gpointer user_data) { MoeMojiApplication *self = MOEMOJI_APPLICATION(user_data);
gtk_widget_set_visible(GTK_WIDGET(window), FALSE); if (self->has_tray) {
return TRUE; gtk_widget_set_visible(GTK_WIDGET(window), FALSE);
return TRUE;
}
return FALSE;
} }
static void dbusmenu_method_call(G_GNUC_UNUSED GDBusConnection *connection, static void dbusmenu_method_call(G_GNUC_UNUSED GDBusConnection *connection,
@@ -291,8 +294,33 @@ static void setup_sni(MoeMojiApplication *self) {
if (self->dbus_conn == NULL) { if (self->dbus_conn == NULL) {
g_warning("session bus: %s", error->message); g_warning("session bus: %s", error->message);
g_clear_error(&error); g_clear_error(&error);
self->has_tray = FALSE;
return; return;
} }
GVariant *result = g_dbus_connection_call_sync(
self->dbus_conn, "org.freedesktop.DBus", "/org/freedesktop/DBus",
"org.freedesktop.DBus", "NameHasOwner",
g_variant_new("(s)", "org.kde.StatusNotifierWatcher"), G_VARIANT_TYPE("(b)"),
G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
if (result == NULL) {
g_warning("NameHasOwner check failed: %s", error->message);
g_clear_error(&error);
self->has_tray = FALSE;
return;
}
gboolean watcher_exists = FALSE;
g_variant_get(result, "(b)", &watcher_exists);
g_variant_unref(result);
if (!watcher_exists) {
g_info("No StatusNotifierWatcher found, skipping tray setup");
self->has_tray = FALSE;
return;
}
self->has_tray = TRUE;
GDBusNodeInfo *sni_node = GDBusNodeInfo *sni_node =
g_dbus_node_info_new_for_xml(sni_introspection_xml, &error); g_dbus_node_info_new_for_xml(sni_introspection_xml, &error);
if (sni_node == NULL) { if (sni_node == NULL) {
@@ -532,7 +560,7 @@ static void moemoji_application_activate(GApplication *app) {
self->window = g_object_new(MOEMOJI_TYPE_WINDOW, "application", self->window = g_object_new(MOEMOJI_TYPE_WINDOW, "application",
GTK_APPLICATION(self), NULL); GTK_APPLICATION(self), NULL);
g_signal_connect(self->window, "close-request", g_signal_connect(self->window, "close-request",
G_CALLBACK(on_close_request), NULL); G_CALLBACK(on_close_request), self);
self->window_created = TRUE; self->window_created = TRUE;
} else { } else {
toggle_window(self); toggle_window(self);
+1
View File
@@ -16,6 +16,7 @@ struct _MoeMojiApplication {
const gchar *tray_icon_name; const gchar *tray_icon_name;
GDBusProxy *shortcuts_proxy; GDBusProxy *shortcuts_proxy;
gchar *shortcuts_session_path; gchar *shortcuts_session_path;
gboolean has_tray;
}; };
G_BEGIN_DECLS G_BEGIN_DECLS