@@ -102,7 +102,7 @@ void add_notification_action(GtkWindow *nw, const char *text, const char *key,
102102void clear_notification_actions (GtkWindow * nw );
103103void move_notification (GtkWidget * nw , int x , int y );
104104void set_notification_timeout (GtkWindow * nw , glong timeout );
105- void set_notification_hints (GtkWindow * nw , GHashTable * hints );
105+ void set_notification_hints (GtkWindow * nw , GVariant * hints );
106106void notification_tick (GtkWindow * nw , glong remaining );
107107
108108#define STRIPE_WIDTH 32
@@ -1082,20 +1082,19 @@ set_notification_timeout(GtkWindow *nw, glong timeout)
10821082}
10831083
10841084/* Set notification hints */
1085- void
1086- set_notification_hints (GtkWindow * nw , GHashTable * hints )
1085+ void set_notification_hints (GtkWindow * nw , GVariant * hints )
10871086{
10881087 WindowData * windata = g_object_get_data (G_OBJECT (nw ), "windata" );
1089- GValue * value = NULL , * icon_value = NULL ;
1088+ GVariant * value = NULL , * icon_value = NULL ;
10901089
10911090 g_assert (windata != NULL );
10921091
1093- value = ( GValue * ) g_hash_table_lookup ( hints , "urgency" );
1094- icon_value = ( GValue * ) g_hash_table_lookup ( hints , "action-icons" );
1092+ g_variant_lookup ( hints , "urgency" , "v" , & value );
1093+ g_variant_lookup ( hints , "action-icons" , "v" , & icon_value );
10951094
1096- if (value != NULL && G_VALUE_HOLDS_UCHAR (value ))
1095+ if (value != NULL && g_variant_get_type (value ) == G_VARIANT_TYPE_BYTE )
10971096 {
1098- windata -> urgency = g_value_get_uchar (value );
1097+ windata -> urgency = g_variant_get_byte (value );
10991098
11001099 if (windata -> urgency == URGENCY_CRITICAL ) {
11011100 gtk_window_set_title (GTK_WINDOW (nw ), "Critical Notification" );
@@ -1105,9 +1104,9 @@ set_notification_hints(GtkWindow *nw, GHashTable *hints)
11051104 }
11061105
11071106 /* Determine if action-icons have been requested */
1108- if (icon_value != NULL && G_VALUE_HOLDS_BOOLEAN (icon_value ))
1107+ if (icon_value != NULL && g_variant_get_type (icon_value ) == G_VARIANT_TYPE_BOOLEAN )
11091108 {
1110- windata -> action_icons = g_value_get_boolean (icon_value );
1109+ windata -> action_icons = g_variant_get_boolean (icon_value );
11111110 }
11121111}
11131112
0 commit comments