*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
+ int oseconds = seconds;
+ Bool was_in_p = !out_p;
+
+ /* When we're asked to fade in, first fade out, then fade in.
+ That way all the transitions are smooth -- from what's on the
+ screen, to black, to the desktop.
+ */
+ if (was_in_p)
+ {
+ clear_windows = True;
+ out_p = True;
+ seconds /= 3;
+ if (seconds == 0)
+ seconds = 1;
+ }
+
+ AGAIN:
+
#ifdef HAVE_SGI_VC_EXTENSION
/* First try to do it by fading the gamma in an SGI-specific way... */
if (0 != sgi_gamma_fade(dpy, black_windows, seconds, ticks, out_p,
#ifdef HAVE_SGI_VC_EXTENSION
/* First try to do it by fading the gamma in an SGI-specific way... */
if (0 != sgi_gamma_fade(dpy, black_windows, seconds, ticks, out_p,
there are TrueColor windows visible. */
fade_screens_1 (dpy, cmaps, black_windows, seconds, ticks,
out_p, clear_windows);
there are TrueColor windows visible. */
fade_screens_1 (dpy, cmaps, black_windows, seconds, ticks,
out_p, clear_windows);
that all screens really go black.
I'm told that this trick also works with XInside's AcceleratedX when using
that all screens really go black.
I'm told that this trick also works with XInside's AcceleratedX when using
TrueColor visuals to co-exist and display properly at the same time.)
This trick works ok on the 24-bit Indy video hardware, but doesn't work at
TrueColor visuals to co-exist and display properly at the same time.)
This trick works ok on the 24-bit Indy video hardware, but doesn't work at
- for (i = 0; i < nscreens; i++)
- {
- if (clear_windows)
- XClearWindow (dpy, black_windows[i]);
- XMapRaised (dpy, black_windows[i]);
- }
-
+ {
+ for (i = 0; i < nscreens; i++)
+ {
+ if (clear_windows)
+ XClearWindow (dpy, black_windows[i]);
+ XMapRaised (dpy, black_windows[i]);
+ }
+ XSync(dpy, False);
+ }
/* Now put the target maps back.
If we're fading out, use the given cmap (or the default cmap, if none.)
/* Now put the target maps back.
If we're fading out, use the given cmap (or the default cmap, if none.)
{
XUnmapWindow (dpy, black_windows[screen]);
XClearWindow (dpy, black_windows[screen]);
{
XUnmapWindow (dpy, black_windows[screen]);
XClearWindow (dpy, black_windows[screen]);
- XClearWindow (dpy, black_windows[i]);
- XMapRaised (dpy, black_windows[i]);
+ XClearWindow (dpy, black_windows[screen]);
+ XMapRaised (dpy, black_windows[screen]);
+ /* I can't explain this; without this delay, we get a flicker.
+ I suppose there's some lossage with stale bits being in the
+ hardware frame buffer or something, and this delay gives it
+ time to flush out. This sucks! */
+ usleep(100000); /* 1/10th second */
+
for (screen = 0; screen < nscreens; screen++)
whack_gamma(dpy, screen, &info[screen], 1.0);
XSync(dpy, False);
for (screen = 0; screen < nscreens; screen++)
whack_gamma(dpy, screen, &info[screen], 1.0);
XSync(dpy, False);
if (ratio < 0) ratio = 0;
if (ratio > 1) ratio = 1;
for (k = 0; k < info->gamma_size; k++)
if (ratio < 0) ratio = 0;
if (ratio > 1) ratio = 1;
for (k = 0; k < info->gamma_size; k++)
XSGIvcStoreGammaColors16(dpy, screen, info->gamma_map, info->nred,
XSGIVC_MComponentRed, info->red2);
XSGIvcStoreGammaColors16(dpy, screen, info->gamma_map, info->ngreen,
XSGIvcStoreGammaColors16(dpy, screen, info->gamma_map, info->nred,
XSGIVC_MComponentRed, info->red2);
XSGIvcStoreGammaColors16(dpy, screen, info->gamma_map, info->ngreen,