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

galago-commits at freedesktop.org galago-commits at freedesktop.org
Thu Jan 12 11:11:02 PST 2006


Author: chipx86
Date: 2006-01-12 11:10:55 -0800 (Thu, 12 Jan 2006)
New Revision: 2425

Modified:
   trunk/notification-daemon/ChangeLog
   trunk/notification-daemon/src/daemon.c
   trunk/notification-daemon/themes/standard/theme.c
Log:
A couple of changes from the bus. I'd like to thank the bus for its contributions.
- Listen to the button-release-event signal instead of "clicked" for notifications.
- Another shot at setting the window shape every time. I've read that there's some gtk 2.8 bug regarding this. Anyhow, in order to guarantee it, I'm always setting the shape in the expose handler.  Even doing it only once or twice in the expose handler causes issues, but setting it every time works. We need a better way...


Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog	2006-01-12 08:58:01 UTC (rev 2424)
+++ trunk/notification-daemon/ChangeLog	2006-01-12 19:10:55 UTC (rev 2425)
@@ -1,3 +1,16 @@
+Thu Jan 12 11:06:27 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/daemon.c:
+	  - Listen to the button-release-event signal instead of "clicked" for
+	    notifications.
+
+	* themes/standard/theme.c:
+	  - Another shot at setting the window shape every time. I've read that
+	    there's some gtk 2.8 bug regarding this. Anyhow, in order to
+	    guarantee it, I'm always setting the shape in the expose handler.
+	    Even doing it only once or twice in the expose handler causes issues,
+	    but setting it every time works. We need a better way...
+
 Thu Jan 12 00:57:22 PST 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* themes/standard/theme.c:

Modified: trunk/notification-daemon/src/daemon.c
===================================================================
--- trunk/notification-daemon/src/daemon.c	2006-01-12 08:58:01 UTC (rev 2424)
+++ trunk/notification-daemon/src/daemon.c	2006-01-12 19:10:55 UTC (rev 2425)
@@ -546,6 +546,7 @@
 
 static void
 _notification_daemon_handle_bubble_widget_default(GtkWindow *nw,
+												  GdkEventButton *button,
 												  NotifyDaemon *daemon)
 {
   _close_notification(daemon,
@@ -769,7 +770,7 @@
         _notify_daemon_process_icon_data(daemon, nw, data);
     }
 
-  g_signal_connect(G_OBJECT(nw), "clicked",
+  g_signal_connect(G_OBJECT(nw), "button-release-event",
 	G_CALLBACK(_notification_daemon_handle_bubble_widget_default), daemon);
 
   theme_show_notification(nw);

Modified: trunk/notification-daemon/themes/standard/theme.c
===================================================================
--- trunk/notification-daemon/themes/standard/theme.c	2006-01-12 08:58:01 UTC (rev 2424)
+++ trunk/notification-daemon/themes/standard/theme.c	2006-01-12 19:10:55 UTC (rev 2425)
@@ -15,6 +15,7 @@
 	int point_y;
 	GdkGC *gc;
 	GdkPoint arrow_points[7];
+	GdkRegion *window_region;
 
 } WindowData;
 
@@ -56,6 +57,8 @@
 					  ARROW_OFFSET + ARROW_WIDTH / 2 - 1, 0,
 					  ARROW_OFFSET + ARROW_WIDTH - 1, ARROW_HEIGHT);
 		gdk_draw_line(win->window, windata->gc, 0, h - 1, w - 1, h - 1);
+		gdk_window_shape_combine_region(win->window, windata->window_region,
+										0, 0);
 	}
 	else
 	{
@@ -156,6 +159,9 @@
 	if (windata->gc != NULL)
 		g_object_unref(G_OBJECT(windata->gc));
 
+	if (windata->window_region != NULL)
+		gdk_region_destroy(windata->window_region);
+
 	gtk_widget_destroy(GTK_WIDGET(nw));
 }
 
@@ -227,7 +233,6 @@
 {
 	GtkRequisition req;
 	int new_height;
-	GdkRegion *region;
 
 	gtk_widget_realize(nw);
 	gtk_widget_size_request(nw, &req);
@@ -255,11 +260,10 @@
 	windata->arrow_points[6].x = 0;
 	windata->arrow_points[6].y = new_height;
 
-	region = gdk_region_polygon(windata->arrow_points,
-								G_N_ELEMENTS(windata->arrow_points),
-								GDK_EVEN_ODD_RULE);
-	gdk_window_shape_combine_region(nw->window, region, 0, 0);
-	gdk_region_destroy(region);
+	windata->window_region =
+		gdk_region_polygon(windata->arrow_points,
+						   G_N_ELEMENTS(windata->arrow_points),
+						   GDK_EVEN_ODD_RULE);
 
 	windata->arrow_points[4].x--;
 	windata->arrow_points[5].x--;
@@ -281,7 +285,7 @@
 	if (windata->has_arrow)
 	{
 		GtkRequisition req;
-		GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(nw));
+		//GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(nw));
 		//GdkScreen *screen   = gdk_display_get_screen(display, disp_screen);
 		//int screen_width    = gdk_screen_get_width(screen);
 		//int screen_height   = gdk_screen_get_height(screen);



More information about the galago-commits mailing list