[Galago-commits] r2944 - in trunk/notification-daemon: . src/themes/standard

galago-commits at freedesktop.org galago-commits at freedesktop.org
Thu Nov 9 16:34:41 PST 2006


Author: chipx86
Date: 2006-11-09 16:34:31 -0800 (Thu, 09 Nov 2006)
New Revision: 2944

Modified:
   trunk/notification-daemon/ChangeLog
   trunk/notification-daemon/src/themes/standard/theme.c
Log:
Clean up a little bit more code. Free the array of shape points earlier.


Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog	2006-11-06 07:57:34 UTC (rev 2943)
+++ trunk/notification-daemon/ChangeLog	2006-11-10 00:34:31 UTC (rev 2944)
@@ -1,3 +1,9 @@
+Thu Nov 09 16:34:03 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/themes/standard/theme.c:
+	  - Clean up a little bit more code. Free the array of shape points
+	    earlier.
+
 Sun Nov 05 23:56:43 PST 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* src/themes/standard/theme.c:

Modified: trunk/notification-daemon/src/themes/standard/theme.c
===================================================================
--- trunk/notification-daemon/src/themes/standard/theme.c	2006-11-06 07:57:34 UTC (rev 2943)
+++ trunk/notification-daemon/src/themes/standard/theme.c	2006-11-10 00:34:31 UTC (rev 2944)
@@ -131,6 +131,7 @@
 {
 	int width;
 	int height;
+	int y;
 	GtkArrowType arrow_type;
 	GdkScreen *screen;
 	int screen_width;
@@ -141,17 +142,13 @@
 	GdkPoint *shape_points;
 	int i = 0;
 
-	width = windata->width;
+	width  = windata->width;
 	height = windata->height;
-	g_print("Creating border with height %d\n", height);
 
 	screen        = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window));
 	screen_width  = gdk_screen_get_width(screen);
 	screen_height = gdk_screen_get_height(screen);
 
-	if (windata->border_points != NULL)
-		g_free(windata->border_points);
-
 	windata->num_border_points = 5;
 
 	if (windata->point_y + height + DEFAULT_ARROW_HEIGHT > screen_height)
@@ -252,9 +249,10 @@
 					ADD_POINT(width - 1, DEFAULT_ARROW_HEIGHT, 1, 0);
 				}
 
-				g_print("Bottom is %d\n", height - 1);
 				ADD_POINT(width - 1, height - 1, 1, 1);
 				ADD_POINT(0, height - 1, 0, 1);
+
+				y = windata->point_y;
 			}
 			else
 			{
@@ -293,6 +291,8 @@
 							  windata->drawn_arrow_begin_y, 0, 0);
 					ADD_POINT(0, height - DEFAULT_ARROW_HEIGHT, 0, 1);
 				}
+
+				y = windata->point_y - height;
 			}
 
 #if 0
@@ -302,9 +302,7 @@
 			gtk_window_move(GTK_WINDOW(nw),
 							windata->point_x - arrow_offset -
 							arrow_side1_width,
-							(arrow_type == GTK_ARROW_UP
-							 ? windata->point_y
-							 : windata->point_y - height));
+							y);
 
 			break;
 
@@ -354,6 +352,7 @@
 						 windata->border_points, windata->num_border_points);
 		gdk_window_shape_combine_region(win->window, windata->window_region,
 										0, 0);
+		g_free(windata->border_points);
 	}
 	else
 	{



More information about the galago-commits mailing list