1 diff -Nur -x '*.orig' -x '*~' libgksu-2.0.7/libgksu/libgksu.c libgksu-2.0.7.new/libgksu/libgksu.c
2 --- libgksu-2.0.7/libgksu/libgksu.c 2008-06-12 18:33:47.000000000 +0200
3 +++ libgksu-2.0.7.new/libgksu/libgksu.c 2008-06-12 18:34:26.000000000 +0200
5 guchar *start_p, *end_p, *frame_p;
11 FadeoutData *fade_data = NULL;
12 static GList *fade_data_l = NULL;
13 static GList *fadeout_windows = NULL;
15 -#define FADE_DURATION 500.0
16 +#define FADE_DURATION 300.0
19 gsm_screen_get_width (GdkScreen *screen,
21 elapsed = G_MAXDOUBLE;
24 - if (elapsed > FADE_DURATION)
25 + if (elapsed > FADE_DURATION )
27 - gdk_draw_pixbuf (fadeout->draw_window,
32 - fadeout->area.width,
33 - fadeout->area.height,
34 - GDK_RGB_DITHER_NONE,
36 + if (fadeout->composited)
38 + gdk_window_set_opacity (fadeout->draw_window, 0.5);
42 + gdk_draw_pixbuf (fadeout->draw_window,
47 + fadeout->area.width,
48 + fadeout->area.height,
49 + GDK_RGB_DITHER_NONE,
56 percent = elapsed / FADE_DURATION;
58 - get_current_frame (fadeout, 1.0 - percent);
59 - gdk_draw_pixbuf (fadeout->draw_window,
64 - fadeout->area.width,
65 - fadeout->area.height,
66 - GDK_RGB_DITHER_NONE,
68 + if (fadeout->composited)
70 + gdk_window_set_opacity (fadeout->draw_window, percent/2);
74 + get_current_frame (fadeout, 1.0 - percent);
75 + gdk_draw_pixbuf (fadeout->draw_window,
80 + fadeout->area.width,
81 + fadeout->area.height,
82 + GDK_RGB_DITHER_NONE,
90 if (elapsed > FADE_DURATION)
92 - gdk_draw_pixbuf (fadeout->draw_window,
97 - fadeout->area.width,
98 - fadeout->area.height,
99 - GDK_RGB_DITHER_NONE,
101 + if (fadeout->composited)
103 + gdk_window_set_opacity (fadeout->draw_window, 0.0);
104 + gdk_window_resize (fadeout->draw_window, 4, 4);
108 + gdk_draw_pixbuf (fadeout->draw_window,
113 + fadeout->area.width,
114 + fadeout->area.height,
115 + GDK_RGB_DITHER_NONE,
119 g_object_unref (fadeout->gc);
120 g_object_unref (fadeout->start_pb);
121 @@ -404,16 +427,23 @@
123 percent = elapsed / FADE_DURATION;
125 - get_current_frame (fadeout, percent);
126 - gdk_draw_pixbuf (fadeout->draw_window,
131 - fadeout->area.width,
132 - fadeout->area.height,
133 - GDK_RGB_DITHER_NONE,
135 + if (fadeout->composited)
137 + gdk_window_set_opacity (fadeout->draw_window, 0.5 - percent/2);
141 + get_current_frame (fadeout, percent);
142 + gdk_draw_pixbuf (fadeout->draw_window,
147 + fadeout->area.width,
148 + fadeout->area.height,
149 + GDK_RGB_DITHER_NONE,
157 fadeout->screen = screen;
158 fadeout->monitor = monitor;
159 + fadeout->composited = gdk_screen_is_composited (screen);
161 fadeout->area.x = gsm_screen_get_x (screen, monitor);
162 fadeout->area.y = gsm_screen_get_y (screen, monitor);
163 @@ -440,11 +471,11 @@
164 fadeout->area.height = gsm_screen_get_height (screen, monitor);
166 fadeout->root_window = gdk_screen_get_root_window (screen);
167 - attr.window_type = GDK_WINDOW_CHILD;
168 + attr.window_type = GDK_WINDOW_TOPLEVEL;
169 attr.x = fadeout->area.x;
170 attr.y = fadeout->area.y;
171 - attr.width = fadeout->area.width;
172 - attr.height = fadeout->area.height;
175 attr.wclass = GDK_INPUT_OUTPUT;
176 attr.visual = gdk_screen_get_system_visual (fadeout->screen);
177 attr.colormap = gdk_screen_get_default_colormap (fadeout->screen);
178 @@ -477,17 +508,29 @@
180 fadeout->gc = gdk_gc_new_with_values (fadeout->root_window, &values, GDK_GC_SUBWINDOW);
182 - gdk_window_set_back_pixmap (fadeout->draw_window, NULL, FALSE);
183 + if (fadeout->composited)
185 + gdk_window_set_opacity (fadeout->draw_window, 0.0);
189 + gdk_window_set_back_pixmap (fadeout->draw_window, NULL, FALSE);
190 + gdk_draw_pixbuf (fadeout->draw_window,
195 + fadeout->area.width,
196 + fadeout->area.height,
197 + GDK_RGB_DITHER_NONE,
201 gdk_window_show (fadeout->draw_window);
202 - gdk_draw_pixbuf (fadeout->draw_window,
207 - fadeout->area.width,
208 - fadeout->area.height,
209 - GDK_RGB_DITHER_NONE,
211 + gdk_window_clear (fadeout->draw_window);
212 + gdk_window_resize (fadeout->draw_window,
213 + fadeout->area.width,
214 + fadeout->area.height);
216 g_get_current_time (&fadeout->start_time);
217 g_idle_add ((GSourceFunc) fadeout_callback, fadeout);