[Galago-commits] r2823 - in trunk/libnotify: . docs/reference/tmpl libnotify

galago-commits at freedesktop.org galago-commits at freedesktop.org
Tue Jun 6 00:28:25 PDT 2006


Author: chipx86
Date: 2006-06-06 00:28:21 -0700 (Tue, 06 Jun 2006)
New Revision: 2823

Modified:
   trunk/libnotify/ChangeLog
   trunk/libnotify/docs/reference/tmpl/notification.sgml
   trunk/libnotify/libnotify/notification.c
   trunk/libnotify/libnotify/notification.h
Log:
Update notify_notification_set_geometry_hints() to take a x, y instead of a GdkRectangle. We don't need the width and height information.


Modified: trunk/libnotify/ChangeLog
===================================================================
--- trunk/libnotify/ChangeLog	2006-06-06 07:14:42 UTC (rev 2822)
+++ trunk/libnotify/ChangeLog	2006-06-06 07:28:21 UTC (rev 2823)
@@ -1,3 +1,12 @@
+Tue Jun 06 00:27:50 PDT 2006  Christian Hammond <chipx86 at 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 at chipx86.com>
 
 	A docs/reference/libnotify-docs.sgml:

Modified: trunk/libnotify/docs/reference/tmpl/notification.sgml
===================================================================
--- trunk/libnotify/docs/reference/tmpl/notification.sgml	2006-06-06 07:14:42 UTC (rev 2822)
+++ trunk/libnotify/docs/reference/tmpl/notification.sgml	2006-06-06 07:28:21 UTC (rev 2823)
@@ -133,7 +133,8 @@
 
 @notification: 
 @screen: 
- at rect: 
+ at x: 
+ at y: 
 
 
 <!-- ##### FUNCTION notify_notification_show ##### -->

Modified: trunk/libnotify/libnotify/notification.c
===================================================================
--- trunk/libnotify/libnotify/notification.c	2006-06-06 07:14:42 UTC (rev 2822)
+++ trunk/libnotify/libnotify/notification.c	2006-06-06 07:28:21 UTC (rev 2823)
@@ -387,44 +387,45 @@
 {
 	NotifyNotificationPrivate *priv = n->priv;
 	GdkScreen *screen = NULL;
-	GdkRectangle rect;
+	gint x, y;
 
 #ifdef HAVE_STATUS_ICON
 	if (priv->status_icon != NULL)
 	{
+		GdkRectangle rect;
+
 		if (!gtk_status_icon_get_geometry(priv->status_icon, &screen,
 										  &rect, NULL))
 		{
 			return;
 		}
+
+		x = rect.x + rect.width / 2;
+		y = rect.y + rect.height / 2;
 	}
 	else
 #endif /* HAVE_STATUS_ICON */
 	if (priv->attached_widget != NULL)
 	{
 		GtkWidget *widget = priv->attached_widget;
-		GtkRequisition requisition;
 
 		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))
 		{
-			rect.x += widget->allocation.x;
-			rect.y += widget->allocation.y;
+			x += widget->allocation.x;
+			y += widget->allocation.y;
 		}
 
-		rect.x += widget->allocation.width / 2;
-		rect.y += widget->allocation.height / 2;
+		x += widget->allocation.width / 2;
+		y += widget->allocation.height / 2;
 	}
 	else
 		return;
 
-	notify_notification_set_geometry_hints(n, screen, &rect);
+	notify_notification_set_geometry_hints(n, screen, x, y);
 }
 
 #if 0
@@ -640,7 +641,8 @@
 void
 notify_notification_set_geometry_hints(NotifyNotification *notification,
 									   GdkScreen *screen,
-									   GdkRectangle *rect)
+									   gint x,
+									   gint y)
 {
 	char *display_name;
 
@@ -648,10 +650,9 @@
 	g_return_if_fail(NOTIFY_IS_NOTIFICATION(notification));
 	g_return_if_fail(screen != NULL);
 	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, "y", rect->y);
+	notify_notification_set_hint_int32(notification, "x", x);
+	notify_notification_set_hint_int32(notification, "y", y);
 
 	display_name = gdk_screen_make_display_name(screen);
 	notify_notification_set_hint_string(notification, "xdisplay", display_name);

Modified: trunk/libnotify/libnotify/notification.h
===================================================================
--- trunk/libnotify/libnotify/notification.h	2006-06-06 07:14:42 UTC (rev 2822)
+++ trunk/libnotify/libnotify/notification.h	2006-06-06 07:28:21 UTC (rev 2823)
@@ -108,7 +108,8 @@
 
 void notify_notification_set_geometry_hints(NotifyNotification *notification,
 											GdkScreen *screen,
-											GdkRectangle *rect);
+											gint x,
+											gint y);
 
 gboolean notify_notification_show(NotifyNotification *notification,
 								  GError **error);



More information about the galago-commits mailing list