[gnome-panel/gtk3] panel: Don't query screen depth when we don't need it when drawing zoom



commit d9f9948a9bf5389250c52e770c1c80c17e655c08
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Feb 1 00:36:14 2011 +0100

    panel: Don't query screen depth when we don't need it when drawing zoom

 gnome-panel/xstuff.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gnome-panel/xstuff.c b/gnome-panel/xstuff.c
index b1d1111..8465341 100644
--- a/gnome-panel/xstuff.c
+++ b/gnome-panel/xstuff.c
@@ -464,21 +464,20 @@ draw_zoom_animation (GdkScreen *gscreen,
 	Display *dpy;
 	Window root_win;
 	int screen;
-	int depth;
 
 	dpy = gdk_x11_display_get_xdisplay (gdk_screen_get_display (gscreen));
 	root_win = GDK_WINDOW_XID (gdk_screen_get_root_window (gscreen));
 	screen = gdk_screen_get_number (gscreen);
-	depth = DefaultDepth(dpy,screen);
 
 	/* frame GC */
 	gcv.function = GXxor;
 	/* this will raise the probability of the XORed color being different
 	 * of the original color in PseudoColor when not all color cells are
 	 * initialized */
-	if (DefaultVisual(dpy, screen)->class==PseudoColor)
+	if (DefaultVisual(dpy, screen)->class==PseudoColor) {
+		int depth = DefaultDepth (dpy, screen);
 		gcv.plane_mask = (1<<(depth-1))|1;
-	else
+	} else
 		gcv.plane_mask = AllPlanes;
 	gcv.foreground = color.pixel;
 	if (gcv.foreground == 0)



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