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

galago-commits at freedesktop.org galago-commits at freedesktop.org
Wed Jan 10 15:06:36 PST 2007


Author: chipx86
Date: 2007-01-10 15:06:16 -0800 (Wed, 10 Jan 2007)
New Revision: 2958

Modified:
   trunk/notification-daemon/ChangeLog
   trunk/notification-daemon/src/themes/standard/theme.c
Log:
Fix a crash when displaying notifications with arrows. I can't believe I didn't catch this before. There's still a bug though where you can't display a notification with arrows while a normal notification is on the screen, but I have no clue why.


Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog	2007-01-05 23:07:52 UTC (rev 2957)
+++ trunk/notification-daemon/ChangeLog	2007-01-10 23:06:16 UTC (rev 2958)
@@ -1,3 +1,11 @@
+Wed Jan 10 15:05:28 PST 2007  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/themes/standard/theme.c:
+	  - Fix a crash when displaying notifications with arrows. I can't believe
+	    I didn't catch this before. There's still a bug though where you can't
+	    display a notification with arrows while a normal notification is on
+	    the screen, but I have no clue why.
+
 Fri Jan 05 15:06:51 PST 2007  Christian Hammond <chipx86 at chipx86.com>
 
 	* po/ChangeLog:

Modified: trunk/notification-daemon/src/themes/standard/theme.c
===================================================================
--- trunk/notification-daemon/src/themes/standard/theme.c	2007-01-05 23:07:52 UTC (rev 2957)
+++ trunk/notification-daemon/src/themes/standard/theme.c	2007-01-10 23:06:16 UTC (rev 2958)
@@ -149,7 +149,7 @@
 	} G_STMT_END
 
 static void
-create_border_with_arrow(GtkWidget *widget, WindowData *windata)
+create_border_with_arrow(GtkWidget *nw, WindowData *windata)
 {
 	int width;
 	int height;
@@ -167,13 +167,13 @@
 	width  = windata->width;
 	height = windata->height;
 
-	screen        = gdk_drawable_get_screen(GDK_DRAWABLE(widget->window));
+	screen        = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window));
 	screen_width  = gdk_screen_get_width(screen);
 	screen_height = gdk_screen_get_height(screen);
 
 	windata->num_border_points = 5;
 
-	arrow_type = get_notification_arrow_type(widget);
+	arrow_type = get_notification_arrow_type(windata->win);
 
 	/* Handle the offset and such */
 	switch (arrow_type)
@@ -314,7 +314,7 @@
 			g_assert(i == windata->num_border_points);
 			g_assert(windata->point_x - arrow_offset - arrow_side1_width >= 0);
 #endif
-			gtk_window_move(GTK_WINDOW(widget),
+			gtk_window_move(GTK_WINDOW(windata->win),
 							windata->point_x - arrow_offset -
 							arrow_side1_width,
 							y);
@@ -334,6 +334,9 @@
 				arrow_offset = windata->point_y - arrow_side1_width;
 			}
 			break;
+
+		default:
+			g_assert_not_reached();
 	}
 
 	g_assert(shape_points != NULL);
@@ -359,11 +362,12 @@
 
 	if (windata->has_arrow)
 	{
-		create_border_with_arrow(widget, windata);
+		create_border_with_arrow(windata->win, windata);
 
 		gdk_draw_polygon(widget->window, windata->gc, FALSE,
 						 windata->border_points, windata->num_border_points);
-		gdk_window_shape_combine_region(widget->window, windata->window_region,
+		gdk_window_shape_combine_region(windata->win->window,
+										windata->window_region,
 										0, 0);
 		g_free(windata->border_points);
 		windata->border_points = NULL;



More information about the galago-commits mailing list