X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fqix.c;h=c26e736746cfef80bb4a0fc7c50132ee65e60814;hb=ccbc9f87eb59497b23bd0424ee1ed20ad7c7db54;hp=e45c795595c0ad6f5b8b49cb45dccd05d4010fdc;hpb=6edc84f12f15860a71430c45e8392a5e4ef8203c;p=xscreensaver diff --git a/hacks/qix.c b/hacks/qix.c index e45c7955..c26e7367 100644 --- a/hacks/qix.c +++ b/hacks/qix.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992, 1995 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -400,9 +400,21 @@ add_qline (dpy, window, cmap, qline, prev_qline, qix) if (!mono_p && !transparent_p) { + XColor desired; cycle_hue (&qline->color, color_shift); qline->color.flags = DoRed | DoGreen | DoBlue; - if (!XAllocColor (dpy, cmap, &qline->color)) + desired = qline->color; + if (XAllocColor (dpy, cmap, &qline->color)) + { + /* XAllocColor returns the actual RGB that the hardware let us + allocate. Restore the requested values into the XColor struct + so that limited-resolution hardware doesn't cause cycle_hue to + get "stuck". */ + qline->color.red = desired.red; + qline->color.green = desired.green; + qline->color.blue = desired.blue; + } + else { qline->color = prev_qline->color; if (!XAllocColor (dpy, cmap, &qline->color))