Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8c147901e | ||
|
|
a566b78721 | ||
|
|
05ca273c38 |
@@ -35,7 +35,7 @@
|
||||
</screenshots>
|
||||
|
||||
<releases>
|
||||
<release version="0.1.0" date="2026-02-28">
|
||||
<release version="0.1.0" date="2026-03-01">
|
||||
<description>
|
||||
<p>Initial release.</p>
|
||||
</description>
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
"buildsystem": "meson",
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitea.angeltech.jp/Angel-Technologies/MoeMoji",
|
||||
"tag": "v0.1.1",
|
||||
"commit": "9106ecc1aee48a985900ff26cccf910cdb02e93e"
|
||||
"type": "archive",
|
||||
"url": "https://gitea.angeltech.jp/Angel-Technologies/MoeMoji/archive/v0.1.2.tar.gz",
|
||||
"sha256": "01fd51050f723fc14ba49f8dc09fb5e67336c7e9a54f0c39cb16c69930b26358"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -93,10 +93,13 @@ static void toggle_window(MoeMojiApplication *self) {
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean on_close_request(GtkWindow *window,
|
||||
G_GNUC_UNUSED gpointer user_data) {
|
||||
static gboolean on_close_request(GtkWindow *window, gpointer user_data) {
|
||||
MoeMojiApplication *self = MOEMOJI_APPLICATION(user_data);
|
||||
if (self->has_tray) {
|
||||
gtk_widget_set_visible(GTK_WIDGET(window), FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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) {
|
||||
g_warning("session bus: %s", error->message);
|
||||
g_clear_error(&error);
|
||||
self->has_tray = FALSE;
|
||||
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 =
|
||||
g_dbus_node_info_new_for_xml(sni_introspection_xml, &error);
|
||||
if (sni_node == NULL) {
|
||||
@@ -532,7 +560,7 @@ static void moemoji_application_activate(GApplication *app) {
|
||||
self->window = g_object_new(MOEMOJI_TYPE_WINDOW, "application",
|
||||
GTK_APPLICATION(self), NULL);
|
||||
g_signal_connect(self->window, "close-request",
|
||||
G_CALLBACK(on_close_request), NULL);
|
||||
G_CALLBACK(on_close_request), self);
|
||||
self->window_created = TRUE;
|
||||
} else {
|
||||
toggle_window(self);
|
||||
|
||||
@@ -16,6 +16,7 @@ struct _MoeMojiApplication {
|
||||
const gchar *tray_icon_name;
|
||||
GDBusProxy *shortcuts_proxy;
|
||||
gchar *shortcuts_session_path;
|
||||
gboolean has_tray;
|
||||
};
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
Reference in New Issue
Block a user