dbus_connection_add_filter(priv->dbus_conn_session,
(DBusHandleMessageFunction)get_livewp_signal_cb,
priv, NULL);
+ filter_string =
+ g_strdup_printf("type='signal', interface='%s'", NOTIFY_SIGNAL_INTERFACE);
+ dbus_bus_add_match(priv->dbus_conn_session, filter_string, &error);
+ if (dbus_error_is_set(&error)){
+ fprintf(stderr,"dbus_bus_add_match failed: %s", error.message);
+ dbus_error_free(&error);
+ }
+ g_free(filter_string);
+ /* add the callback */
+ dbus_connection_add_filter(priv->dbus_conn_session,
+ (DBusHandleMessageFunction)get_livewp_signal_cb,
+ priv, NULL);
+
}
}
/*******************************************************************************/
}
g_free(filter_string);
+ filter_string =
+ g_strdup_printf("type='signal', interface='%s'", NOTIFY_SIGNAL_INTERFACE);
+
+ dbus_error_init (&error);
+ dbus_bus_remove_match(priv->dbus_conn_session, filter_string, &error);
+ if (!dbus_error_is_set(&error)){
+ dbus_connection_remove_filter(priv->dbus_conn_session,
+ (DBusHandleMessageFunction)get_livewp_signal_cb,
+ NULL);
+ }else{
+
+ fprintf(stderr,"dbus_bus_add_match failed: %s", error.message);
+ dbus_error_free(&error);
+ }
+
+ g_free(filter_string);
+
}
}
START_FUNCTION;
#endif
- //fprintf (stderr, "PATH11111111111111111111 %s %s %s\n", dbus_message_get_path(msg), dbus_message_get_interface (msg), dbus_message_get_member (msg));
+ fprintf (stderr, "PATH11111111111111111111 %s %s %s\n", dbus_message_get_path(msg), dbus_message_get_interface (msg), dbus_message_get_member (msg));
if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_RELOAD_CONFIG)){
if(read_config(priv)){
fprintf(stderr, "\nCan not read config file.\n");
#endif
}
}
- if (dbus_message_is_signal(msg, NOTIFY_SIGNAL_INTERFACE, NOTIFY_MEMBER)
- || dbus_message_is_signal(msg, CLOSENOTIFY_SIGNAL_INTERFACE, CLOSENOTIFY_MEMBER) ){
- //fprintf(stderr,"read notifications.db\n");
+ if (dbus_message_is_signal(msg, NOTIFY_SIGNAL_INTERFACE, NOTIFY_MEMBER)){
+ fprintf(stderr,"read notifications.db\n");
read_notification(priv->desktop_plugin);
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;