Update notify_notification_set_geometry_hints() to take a x, y instead of a GdkRectangle. We don't need the width and height information.

This commit is contained in:
Christian Hammond 2006-06-06 07:28:21 +00:00
parent cc13b1892f
commit 2ef25f78f9
4 changed files with 29 additions and 17 deletions

View File

@ -1,3 +1,12 @@
Tue Jun 06 00:27:50 PDT 2006 Christian Hammond <chipx86@chipx86.com>
* docs/reference/tmpl/notification.sgml:
* libnotify/notification.c:
* libnotify/notification.h:
- Update notify_notification_set_geometry_hints() to take a x, y
instead of a GdkRectangle. We don't need the width and height
information.
Tue Jun 06 00:14:00 PDT 2006 Christian Hammond <chipx86@chipx86.com> Tue Jun 06 00:14:00 PDT 2006 Christian Hammond <chipx86@chipx86.com>
A docs/reference/libnotify-docs.sgml: A docs/reference/libnotify-docs.sgml:

View File

@ -133,7 +133,8 @@ NotifyNotification
@notification: @notification:
@screen: @screen:
@rect: @x:
@y:
<!-- ##### FUNCTION notify_notification_show ##### --> <!-- ##### FUNCTION notify_notification_show ##### -->

View File

@ -387,44 +387,45 @@ _notify_notification_update_applet_hints(NotifyNotification *n)
{ {
NotifyNotificationPrivate *priv = n->priv; NotifyNotificationPrivate *priv = n->priv;
GdkScreen *screen = NULL; GdkScreen *screen = NULL;
GdkRectangle rect; gint x, y;
#ifdef HAVE_STATUS_ICON #ifdef HAVE_STATUS_ICON
if (priv->status_icon != NULL) if (priv->status_icon != NULL)
{ {
GdkRectangle rect;
if (!gtk_status_icon_get_geometry(priv->status_icon, &screen, if (!gtk_status_icon_get_geometry(priv->status_icon, &screen,
&rect, NULL)) &rect, NULL))
{ {
return; return;
} }
x = rect.x + rect.width / 2;
y = rect.y + rect.height / 2;
} }
else else
#endif /* HAVE_STATUS_ICON */ #endif /* HAVE_STATUS_ICON */
if (priv->attached_widget != NULL) if (priv->attached_widget != NULL)
{ {
GtkWidget *widget = priv->attached_widget; GtkWidget *widget = priv->attached_widget;
GtkRequisition requisition;
screen = gtk_widget_get_screen(widget); screen = gtk_widget_get_screen(widget);
gtk_widget_size_request(widget, &requisition);
rect.width = requisition.width;
rect.height = requisition.height;
gdk_window_get_origin(widget->window, &rect.x, &rect.y); gdk_window_get_origin(widget->window, &x, &y);
if (GTK_WIDGET_NO_WINDOW(widget)) if (GTK_WIDGET_NO_WINDOW(widget))
{ {
rect.x += widget->allocation.x; x += widget->allocation.x;
rect.y += widget->allocation.y; y += widget->allocation.y;
} }
rect.x += widget->allocation.width / 2; x += widget->allocation.width / 2;
rect.y += widget->allocation.height / 2; y += widget->allocation.height / 2;
} }
else else
return; return;
notify_notification_set_geometry_hints(n, screen, &rect); notify_notification_set_geometry_hints(n, screen, x, y);
} }
#if 0 #if 0
@ -640,7 +641,8 @@ notify_notification_attach_to_status_icon(NotifyNotification *notification,
void void
notify_notification_set_geometry_hints(NotifyNotification *notification, notify_notification_set_geometry_hints(NotifyNotification *notification,
GdkScreen *screen, GdkScreen *screen,
GdkRectangle *rect) gint x,
gint y)
{ {
char *display_name; char *display_name;
@ -648,10 +650,9 @@ notify_notification_set_geometry_hints(NotifyNotification *notification,
g_return_if_fail(NOTIFY_IS_NOTIFICATION(notification)); g_return_if_fail(NOTIFY_IS_NOTIFICATION(notification));
g_return_if_fail(screen != NULL); g_return_if_fail(screen != NULL);
g_return_if_fail(GDK_IS_SCREEN(screen)); g_return_if_fail(GDK_IS_SCREEN(screen));
g_return_if_fail(rect != NULL);
notify_notification_set_hint_int32(notification, "x", rect->x); notify_notification_set_hint_int32(notification, "x", x);
notify_notification_set_hint_int32(notification, "y", rect->y); notify_notification_set_hint_int32(notification, "y", y);
display_name = gdk_screen_make_display_name(screen); display_name = gdk_screen_make_display_name(screen);
notify_notification_set_hint_string(notification, "xdisplay", display_name); notify_notification_set_hint_string(notification, "xdisplay", display_name);

View File

@ -108,7 +108,8 @@ void notify_notification_attach_to_status_icon(NotifyNotification *notification,
void notify_notification_set_geometry_hints(NotifyNotification *notification, void notify_notification_set_geometry_hints(NotifyNotification *notification,
GdkScreen *screen, GdkScreen *screen,
GdkRectangle *rect); gint x,
gint y);
gboolean notify_notification_show(NotifyNotification *notification, gboolean notify_notification_show(NotifyNotification *notification,
GError **error); GError **error);