Ticket #63: libnotify.diff
-
libnotify/notification.c
old new 207 207 g_object_class_install_property 208 208 (object_class, 209 209 PROP_STATUS_ICON, 210 g_param_spec_object(" status-icon",211 " StatusIcon",212 " StatusIcon",210 g_param_spec_object("attach-icon", 211 "Attach Icon", 212 "Attach Icon", 213 213 GTK_TYPE_STATUS_ICON, 214 214 G_PARAM_READWRITE | 215 215 G_PARAM_CONSTRUCT | … … 361 361 if (priv->attached_widget != NULL) 362 362 g_object_unref(G_OBJECT(priv->attached_widget)); 363 363 364 #if HAVE_STATUS_ICON364 #ifdef HAVE_STATUS_ICON 365 365 if (priv->status_icon != NULL) 366 366 g_object_remove_weak_pointer(G_OBJECT(priv->status_icon), 367 367 (gpointer)&priv->status_icon); … … 388 388 NotifyNotificationPrivate *priv = n->priv; 389 389 GdkScreen *screen = NULL; 390 390 GdkRectangle rect; 391 GtkOrientation orientation = GTK_ORIENTATION_HORIZONTAL; 391 392 392 393 #ifdef HAVE_STATUS_ICON 393 394 if (priv->status_icon != NULL) 394 395 { 395 396 if (!gtk_status_icon_get_geometry(priv->status_icon, &screen, 396 &rect, NULL))397 &rect, &orientation)) 397 398 { 398 399 return; 399 400 } … … 424 425 else 425 426 return; 426 427 427 notify_notification_set_geometry_hints(n, screen, &rect );428 notify_notification_set_geometry_hints(n, screen, &rect, orientation); 428 429 } 429 430 430 431 #if 0 … … 487 488 "summary", summary, 488 489 "body", message, 489 490 "icon-name", icon, 490 " status-icon", status_icon,491 "attach-icon", status_icon, 491 492 NULL); 492 493 } 493 494 #endif /* HAVE_STATUS_ICON */ … … 552 553 notify_notification_attach_to_status_icon(NotifyNotification *notification, 553 554 GtkStatusIcon *status_icon) 554 555 { 556 NotifyNotificationPrivate *priv; 557 555 558 g_return_if_fail(NOTIFY_IS_NOTIFICATION(notification)); 556 559 g_return_if_fail(status_icon == NULL || GTK_IS_STATUS_ICON(status_icon)); 557 560 558 if (notification->priv->status_icon == status_icon) 561 priv = notification->priv; 562 if (priv->status_icon == status_icon) 559 563 return; 560 564 561 565 if (priv->status_icon != NULL) … … 579 583 void 580 584 notify_notification_set_geometry_hints(NotifyNotification *notification, 581 585 GdkScreen *screen, 582 GdkRectangle *rect) 586 GdkRectangle *rect, 587 GtkOrientation orientation) 583 588 { 584 589 char *display_name; 585 590 … … 597 602 display_name = gdk_screen_make_display_name(screen); 598 603 notify_notification_set_hint_string(notification, "xdisplay", display_name); 599 604 g_free(display_name); 605 606 notify_notification_set_hint_enum(notification, "orientation", 607 GTK_TYPE_ORIENTATION, 608 orientation); 600 609 } 601 610 602 611 static void … … 889 898 } 890 899 891 900 void 901 notify_notification_set_hint_enum(NotifyNotification *notification, 902 const gchar *key, 903 GType enum_type, 904 gint enum_value) 905 { 906 GEnumClass *klass; 907 const GEnumValue *value; 908 909 g_return_if_fail(NOTIFY_IS_NOTIFICATION(notification)); 910 g_return_if_fail(key != NULL && *key != '\0'); 911 912 /* Translate the enum into a string since dbus cannot marshal it otherwise */ 913 914 klass = g_type_class_ref(enum_type); 915 value = g_enum_get_value(klass, enum_value); 916 g_assert(value != NULL); 917 notify_notification_set_hint_string(notification, key, value->value_nick); 918 g_type_class_unref(klass); 919 } 920 921 void 892 922 notify_notification_set_hint_byte(NotifyNotification *notification, 893 923 const gchar *key, guchar value) 894 924 { -
libnotify/notification.h
old new 108 108 109 109 void notify_notification_set_geometry_hints(NotifyNotification *notification, 110 110 GdkScreen *screen, 111 GdkRectangle *rect); 111 GdkRectangle *rect, 112 GtkOrientation orientation); 112 113 113 114 gboolean notify_notification_show(NotifyNotification *notification, 114 115 GError **error); … … 138 139 void notify_notification_set_hint_byte(NotifyNotification *notification, 139 140 const gchar *key, guchar value); 140 141 142 void notify_notification_set_hint_enum(NotifyNotification *notification, 143 const gchar *key, 144 GType enum_type, 145 gint enum_value); 146 141 147 void notify_notification_set_hint_byte_array(NotifyNotification *notification, 142 148 const gchar *key, 143 149 const guchar *value, gsize len);
