Remove live status checking (for now)
This commit is contained in:
parent
ee11dfa8fe
commit
9049bf15b2
37
src/dbus.c
37
src/dbus.c
@ -573,43 +573,6 @@ void signal_action_invoked(const struct notification *n, const char *identifier)
|
||||
}
|
||||
}
|
||||
|
||||
//FIXME: Is this necessary or alternative question: Is this implemented correctl?
|
||||
// This had been an old relict from the manual times, when I haven't used the
|
||||
// interface vtable of GLib
|
||||
void dbus_signal_status_changed(struct dunst_status status)
|
||||
{
|
||||
// We might have not a working connection yet, so just ignore it.
|
||||
if (!dbus_conn)
|
||||
return;
|
||||
|
||||
//TODO: I'm pretty sure this is the right format string, but I don't know how to verify it
|
||||
GVariantBuilder builder;
|
||||
g_variant_builder_init(&builder, G_VARIANT_TYPE("(sa{sv}as)"));
|
||||
g_variant_builder_add(&builder, "s", DUNST_IFAC);
|
||||
|
||||
g_variant_builder_open(&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||
g_variant_builder_add(&builder, "{sv}", "running", g_variant_new_boolean(status.running));
|
||||
g_variant_builder_close(&builder);
|
||||
|
||||
g_variant_builder_open(&builder, G_VARIANT_TYPE ("as"));
|
||||
g_variant_builder_add(&builder, "s", "unrelated");
|
||||
g_variant_builder_close(&builder);
|
||||
|
||||
GError *err = NULL;
|
||||
g_dbus_connection_emit_signal(dbus_conn,
|
||||
NULL,
|
||||
DUNST_PATH,
|
||||
PROPERTIES_IFAC,
|
||||
"PropertiesChanged",
|
||||
g_variant_builder_end(&builder),
|
||||
&err);
|
||||
|
||||
if (err) {
|
||||
LOG_W("Unable send signal 'PropertiesChanged': %s", err->message);
|
||||
g_error_free(err);
|
||||
}
|
||||
}
|
||||
|
||||
GVariant *dbus_cb_dunst_Properties_Get(GDBusConnection *connection,
|
||||
const gchar *sender,
|
||||
const gchar *object_path,
|
||||
|
@ -21,12 +21,5 @@ void dbus_teardown(int id);
|
||||
void signal_notification_closed(struct notification *n, enum reason reason);
|
||||
void signal_action_invoked(const struct notification *n, const char *identifier);
|
||||
|
||||
/**
|
||||
* Signal a changed status via DBus
|
||||
*
|
||||
* @param status The current status of dunst
|
||||
* */
|
||||
void dbus_signal_status_changed(struct dunst_status status);
|
||||
|
||||
#endif
|
||||
/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */
|
||||
|
@ -31,26 +31,20 @@ static struct dunst_status status;
|
||||
void dunst_status(const enum dunst_status_field field,
|
||||
bool value)
|
||||
{
|
||||
bool changed;
|
||||
switch (field) {
|
||||
case S_FULLSCREEN:
|
||||
changed = status.fullscreen != value;
|
||||
status.fullscreen = value;
|
||||
break;
|
||||
case S_IDLE:
|
||||
changed = status.idle != value;
|
||||
status.idle = value;
|
||||
break;
|
||||
case S_RUNNING:
|
||||
changed = status.running != value;
|
||||
status.running = value;
|
||||
break;
|
||||
default:
|
||||
LOG_E("Invalid %s enum value in %s:%d", "dunst_status", __FILE__, __LINE__);
|
||||
break;
|
||||
}
|
||||
if (changed)
|
||||
dbus_signal_status_changed(status);
|
||||
}
|
||||
|
||||
/* see dunst.h */
|
||||
|
Loading…
x
Reference in New Issue
Block a user