summaryrefslogtreecommitdiff
path: root/xfce4-session/xfsm-fadeout.c
diff options
context:
space:
mode:
authorBenedikt Meurer <benny@xfce.org>2006-12-21 21:50:25 +0000
committerBenedikt Meurer <benny@xfce.org>2006-12-21 21:50:25 +0000
commited0bd9e61c3094a9997be7325fcc7318b442b1db (patch)
tree4321b9a4445fc2fc942fc0323ff56fbae23dab95 /xfce4-session/xfsm-fadeout.c
parente6e2b568f96494f977a3b91dc4ba3e9162c72d02 (diff)
downloadxfce4-session-ed0bd9e61c3094a9997be7325fcc7318b442b1db.tar.gz
2006-12-21 Benedikt Meurer <benny@xfce.org>
* libxfsm/xfsm-util.c, xfce4-session/shutdown.c: Apply Jasper's patch to drop the old-style header from the logout dialog. Bug #2653. * xfce4-session/xfsm-fadeout.c: Use Xrender to fadeout the background if cairo is available, as it gives better results. (Old svn revision: 24158)
Diffstat (limited to 'xfce4-session/xfsm-fadeout.c')
-rw-r--r--xfce4-session/xfsm-fadeout.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/xfce4-session/xfsm-fadeout.c b/xfce4-session/xfsm-fadeout.c
index 9fb3d93c..690bd6a2 100644
--- a/xfce4-session/xfsm-fadeout.c
+++ b/xfce4-session/xfsm-fadeout.c
@@ -1,6 +1,6 @@
/* $Id$ */
/*-
- * Copyright (c) 2004 Benedikt Meurer <benny@xfce.org>
+ * Copyright (c) 2004-2006 Benedikt Meurer <benny@xfce.org>
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#include <gtk/gtk.h>
+
#include <xfce4-session/xfsm-fadeout.h>
@@ -80,6 +82,14 @@ xfsm_fadeout_new (GdkDisplay *display)
cursor = gdk_cursor_new (GDK_WATCH);
+ attr.x = 0;
+ attr.y = 0;
+ attr.event_mask = 0;
+ attr.wclass = GDK_INPUT_OUTPUT;
+ attr.window_type = GDK_WINDOW_TEMP;
+ attr.cursor = cursor;
+ attr.override_redirect = TRUE;
+
for (n = 0; n < gdk_display_get_n_screens (display); ++n)
{
screen = g_new (FoScreen, 1);
@@ -98,15 +108,8 @@ xfsm_fadeout_new (GdkDisplay *display)
0, 0, 0, 0, width, height);
xfsm_fadeout_drawable_mono (fadeout, GDK_DRAWABLE (screen->backbuf));
- attr.x = 0;
- attr.y = 0;
attr.width = width;
attr.height = height;
- attr.event_mask = 0;
- attr.wclass = GDK_INPUT_OUTPUT;
- attr.window_type = GDK_WINDOW_TEMP;
- attr.cursor = cursor;
- attr.override_redirect = TRUE;
screen->window = gdk_window_new (root, &attr, GDK_WA_X | GDK_WA_Y
| GDK_WA_NOREDIR | GDK_WA_CURSOR);
@@ -150,6 +153,15 @@ static void
xfsm_fadeout_drawable_mono (XfsmFadeout *fadeout,
GdkDrawable *drawable)
{
+#if GTK_CHECK_VERSION(2,8,0)
+ cairo_t *cr;
+
+ /* using Xrender gives better results */
+ cr = gdk_cairo_create (drawable);
+ gdk_cairo_set_source_color (cr, &fadeout->color);
+ cairo_paint_with_alpha (cr, 0.5);
+ cairo_destroy (cr);
+#else
GdkGCValues values;
GdkBitmap *bm;
GdkGC *gc;
@@ -175,5 +187,6 @@ xfsm_fadeout_drawable_mono (XfsmFadeout *fadeout,
g_object_unref (G_OBJECT (gc));
g_object_unref (G_OBJECT (bm));
+#endif
}