diff options
author | Colomban Wendling <[email protected]> | 2017-01-20 11:03:03 +0100 |
---|---|---|
committer | lukefromdc <[email protected]> | 2017-01-23 13:49:34 -0500 |
commit | da419c619744efc754e72df2e2101a32adca8a37 (patch) | |
tree | 37df54c88607741686a5e2a50a49b90811c021a2 /applets/notification_area/status-notifier/sn-item.c | |
parent | 7d39b2e82f46777efa67224f078c1cec9e827654 (diff) | |
download | mate-panel-da419c619744efc754e72df2e2101a32adca8a37.tar.bz2 mate-panel-da419c619744efc754e72df2e2101a32adca8a37.tar.xz |
Lower GLib dependency
Diffstat (limited to 'applets/notification_area/status-notifier/sn-item.c')
-rw-r--r-- | applets/notification_area/status-notifier/sn-item.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/applets/notification_area/status-notifier/sn-item.c b/applets/notification_area/status-notifier/sn-item.c index 13ee68f3..9bd16314 100644 --- a/applets/notification_area/status-notifier/sn-item.c +++ b/applets/notification_area/status-notifier/sn-item.c @@ -22,7 +22,7 @@ #include "na-item.h" -typedef struct +struct _SnItemPrivate { gchar *bus_name; gchar *object_path; @@ -30,7 +30,7 @@ typedef struct GtkOrientation orientation; GtkMenu *menu; -} SnItemPrivate; +}; enum { @@ -56,18 +56,12 @@ static guint signals[LAST_SIGNAL] = { 0 }; static void na_item_init (NaItemInterface *iface); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (SnItem, sn_item, GTK_TYPE_BUTTON, - //~ G_ADD_PRIVATE (SnItem); G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL) G_IMPLEMENT_INTERFACE (NA_TYPE_ITEM, na_item_init)) -/* FIXME: apparently if requesting < 2.38, G_ADD_PRIVATE() or the default - * sn_item_get_instance_private() does NOT work, and returns some garbage - * (either get_instance_private() works but G_ADD_PRIVATE() didn't do nothing, - * or the other way around, but it leads to using incorrect memory) */ -#define sn_item_get_instance_private(i) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((i), SN_TYPE_ITEM, SnItemPrivate)) +#define sn_item_get_instance_private(i) (SN_ITEM (i)->priv) static void sn_item_dispose (GObject *object) @@ -461,6 +455,8 @@ sn_item_class_init (SnItemClass *item_class) static void sn_item_init (SnItem *item) { + item->priv = G_TYPE_INSTANCE_GET_PRIVATE (item, SN_TYPE_ITEM, SnItemPrivate); + gtk_widget_add_events (GTK_WIDGET (item), GDK_SCROLL_MASK); } |