Skip to content

Commit

Permalink
Merge pull request #1444 from bynect/fix-libnotify
Browse files Browse the repository at this point in the history
Use properties instead of private fields in dunstify
  • Loading branch information
bynect authored Feb 25, 2025
2 parents fe7f928 + 2099296 commit 73c7f92
Showing 1 changed file with 8 additions and 41 deletions.
49 changes: 8 additions & 41 deletions dunstify.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,53 +173,20 @@ void parse_commandline(int argc, char *argv[])
}
}

typedef struct _NotifyNotificationPrivate
{
guint32 id;
char *app_name;
char *summary;
char *body;

/* NULL to use icon data. Anything else to have server lookup icon */
char *icon_name;

/*
* -1 = use server default
* 0 = never timeout
* > 0 = Number of milliseconds before we timeout
*/
gint timeout;

GSList *actions;
GHashTable *action_map;
GHashTable *hints;

gboolean has_nondefault_actions;
gboolean updates_pending;

gulong proxy_signal_handler;

gint closed_reason;
} knickers;

int get_id(NotifyNotification *n)
{
knickers *kn = n->priv;

/* I'm sorry for taking a peek */
return kn->id;
GValue value = G_VALUE_INIT;
g_value_init(&value, G_TYPE_UINT);
g_object_get_property(G_OBJECT(n), "id", &value);
return g_value_get_int(&value);
}

void put_id(NotifyNotification *n, guint32 id)
{
knickers *kn = n->priv;

/* And now I'm putting stuff into
* your knickers. I'm sorry.
* I'm so sorry.
* */

kn->id = id;
GValue value = G_VALUE_INIT;
g_value_init(&value, G_TYPE_UINT);
g_value_set_uint(&value, id);
g_object_set_property(G_OBJECT(n), "id", &value);
}

void actioned(NotifyNotification *n, char *a, gpointer foo)
Expand Down

0 comments on commit 73c7f92

Please sign in to comment.