Bugfix: iris effect at logout



Hi all,

This is a patch for the gnome-session module. It fixes a bug in the iris
effect at logout, which overlap rectangles with negative height.

-- 
Greetings, alo.
Index: logout.c
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/logout.c,v
retrieving revision 1.35
diff -u -b -B -w -p -r1.35 logout.c
--- logout.c	24 May 2002 06:01:35 -0000	1.35
+++ logout.c	27 May 2002 20:08:54 -0000
@@ -63,15 +63,28 @@ iris_callback (gpointer data)
   gint i;
   gint width_step;
   gint height_step;
+  gint width;
+  gint height;
 
   width_step = MIN (iris_rect.width / 2, iris_block);
   height_step = MIN (iris_rect.width / 2, iris_block);
 
   for (i = 0; i < MIN (width_step, height_step); i++)
+  {
+		width  = (gint)iris_rect.width  - 2 * i;
+		height = (gint)iris_rect.height - 2 * i;
+
+		if (width < 0)
+			   width = 0;
+		if (height < 0)
+			   height = 0;
+
     gdk_draw_rectangle (GDK_ROOT_PARENT (), iris_gc, FALSE,
 			iris_rect.x + i, iris_rect.y + i,
-			(gint)iris_rect.width - 2 * i,
-			(gint)iris_rect.height - 2 * i);
+						width,
+						height);
+
+  }
 
   gdk_flush ();
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/ChangeLog,v
retrieving revision 1.288
diff -u -b -B -w -p -r1.288 ChangeLog
--- ChangeLog	24 May 2002 06:01:35 -0000	1.288
+++ ChangeLog	27 May 2002 20:08:59 -0000
@@ -1,3 +1,8 @@
+2002-05-27  Alvaro Lopez Ortega  <alvaro 0x50 org>
+
+	* logout.c (iris_callback): don't overlap rectangles if the
+	screen is not a square.
+
 2002-05-25  Mark McLoughlin  <mark skynet ie>
 
 	* logout.c: (display_gui): revert back the dialog to OK_CANCEL.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]