|
27 | 27 | #include "gdbusconnection.h"
|
28 | 28 | #include "gactiongroup.h"
|
29 | 29 | #include "gaction.h"
|
| 30 | +#include "gthemedicon.h" |
30 | 31 | #include "gfileicon.h"
|
31 | 32 | #include "gfile.h"
|
32 | 33 | #include "gdbusutils.h"
|
@@ -262,13 +263,23 @@ call_notify (GDBusConnection *con,
|
262 | 263 | urgency = urgency_from_priority (g_notification_get_priority (notification));
|
263 | 264 | g_variant_builder_add (&hints_builder, "{sv}", "urgency", g_variant_new_byte (urgency));
|
264 | 265 | icon = g_notification_get_icon (notification);
|
265 |
| - if (icon != NULL && G_IS_FILE_ICON (icon)) |
| 266 | + if (icon != NULL) |
266 | 267 | {
|
267 |
| - GFile *file; |
| 268 | + if (G_IS_FILE_ICON (icon)) |
| 269 | + { |
| 270 | + GFile *file; |
268 | 271 |
|
269 |
| - file = g_file_icon_get_file (G_FILE_ICON (icon)); |
270 |
| - g_variant_builder_add (&hints_builder, "{sv}", "image-path", |
271 |
| - g_variant_new_take_string (g_file_get_path (file))); |
| 272 | + file = g_file_icon_get_file (G_FILE_ICON (icon)); |
| 273 | + g_variant_builder_add (&hints_builder, "{sv}", "image-path", |
| 274 | + g_variant_new_take_string (g_file_get_path (file))); |
| 275 | + } |
| 276 | + else if (G_IS_THEMED_ICON (icon)) |
| 277 | + { |
| 278 | + const gchar* const* icon_names = g_themed_icon_get_names(G_THEMED_ICON (icon)); |
| 279 | + /* Take first name from GThemedIcon */ |
| 280 | + g_variant_builder_add (&hints_builder, "{sv}", "image-path", |
| 281 | + g_variant_new_string (icon_names[0])); |
| 282 | + } |
272 | 283 | }
|
273 | 284 |
|
274 | 285 | body = g_notification_get_body (notification);
|
|
0 commit comments