#include <sys/time.h>
#include <time.h>
#include <unistd.h>
+#include <getopt.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
int shadow_width;
int shadow_height;
unsigned int opacity;
-
+ Atom windowType;
unsigned long damage_sequence; /* sequence when damage was created */
/* for drawing translucent windows */
struct _fade *next;
win *w;
double cur;
+ double finish;
double step;
void (*callback) (Display *dpy, win *w, Bool gone);
Display *dpy;
/* find these once and be done with it */
Atom opacityAtom;
+Atom winTypeAtom;
+Atom winDesktopAtom;
+Atom winDockAtom;
+Atom winToolbarAtom;
+Atom winMenuAtom;
+Atom winUtilAtom;
+Atom winSplashAtom;
+Atom winDialogAtom;
+Atom winNormalAtom;
/* opacity property name; sometime soon I'll write up an EWMH spec for it */
#define OPACITY_PROP "_NET_WM_WINDOW_OPACITY"
static void
determine_mode(Display *dpy, win *w);
+static double
+get_opacity_percent(Display *dpy, win *w, double def);
+
+static XserverRegion
+win_extents (Display *dpy, win *w);
+
CompMode compMode = CompSimple;
int shadowRadius = 12;
+int shadowOffsetX = -15;
+int shadowOffsetY = -15;
+double shadowOpacity = .75;
-double fade_step = 0.05;
+double fade_in_step = 0.028;
+double fade_out_step = 0.03;
int fade_delta = 10;
int fade_time = 0;
-Bool fadeWindows;
+Bool fadeWindows = False;
+Bool excludeDockShadows = False;
+Bool fadeTrans = False;
Bool autoRedirect = False;
+/* For shadow precomputation */
+int Gsize = -1;
+unsigned char *shadowCorner = NULL;
+unsigned char *shadowTop = NULL;
+
int
get_time_in_milliseconds ()
{
}
static void
-set_fade (Display *dpy, win *w, Bool in,
+set_fade (Display *dpy, win *w, double start, double finish, double step,
void (*callback) (Display *dpy, win *w, Bool gone),
- Bool gone)
+ Bool gone, Bool exec_callback, Bool override)
{
fade *f;
f = malloc (sizeof (fade));
f->next = 0;
f->w = w;
- if (in)
- f->cur = 0;
- else
- f->cur = 1;
+ f->cur = start;
enqueue_fade (dpy, f);
}
- if (in)
- f->step = fade_step;
+ else if(!override)
+ return;
else
- f->step = -fade_step;
+ {
+ if (exec_callback)
+ if (f->callback)
+ (*f->callback)(dpy, f->w, f->gone);
+ }
+
+ if (finish < 0)
+ finish = 0;
+ if (finish > 1)
+ finish = 1;
+ f->finish = finish;
+ if (f->cur < finish)
+ f->step = step;
+ else if (f->cur > finish)
+ f->step = -step;
f->callback = callback;
f->gone = gone;
w->opacity = f->cur * OPAQUE;
printf ("set_fade start %g step %g\n", f->cur, f->step);
#endif
determine_mode (dpy, w);
+ if (w->shadow)
+ {
+ XRenderFreePicture (dpy, w->shadow);
+ w->shadow = None;
+ w->extents = win_extents (dpy, w);
+ }
}
int
int now = get_time_in_milliseconds();
fade *f, *next;
int steps;
+ Bool need_dequeue;
#if 0
printf ("run fades\n");
printf ("opacity now %g\n", f->cur);
#endif
w->opacity = f->cur * OPAQUE;
+ need_dequeue = False;
if (f->step > 0)
{
- if (f->cur >= 1)
- dequeue_fade (dpy, f);
+ if (f->cur >= f->finish)
+ {
+ w->opacity = f->finish*OPAQUE;
+ need_dequeue = True;
+ }
}
else
{
- if (f->cur <= 0)
- dequeue_fade (dpy, f);
+ if (f->cur <= f->finish)
+ {
+ w->opacity = f->finish*OPAQUE;
+ need_dequeue = True;
+ }
}
determine_mode (dpy, w);
+ if (w->shadow)
+ {
+ XRenderFreePicture (dpy, w->shadow);
+ w->shadow = None;
+ w->extents = win_extents(dpy, w);
+ }
+ /* Must do this last as it might destroy f->w in callbacks */
+ if (need_dequeue)
+ dequeue_fade (dpy, f);
}
fade_time = now + fade_delta;
}
-#define SHADOW_OPACITY 0.75
-#define SHADOW_OFFSET_X (-shadowRadius * 5 / 4)
-#define SHADOW_OFFSET_Y (-shadowRadius * 5 / 4)
-
static double
gaussian (double r, double x, double y)
{
return ((unsigned char) (v * opacity * 255.0));
}
+/* precompute shadow corners and sides to save time for large windows */
+static void
+presum_gaussian (conv *map)
+{
+ int center = map->size/2;
+ int opacity, x, y;
+
+ Gsize = map->size;
+
+ if (shadowCorner)
+ free ((void *)shadowCorner);
+ if (shadowTop)
+ free ((void *)shadowTop);
+
+ shadowCorner = (unsigned char *)(malloc ((Gsize + 1) * (Gsize + 1) * 26));
+ shadowTop = (unsigned char *)(malloc ((Gsize + 1) * 26));
+
+ for (x = 0; x <= Gsize; x++)
+ {
+ shadowTop[25 * (Gsize + 1) + x] = sum_gaussian (map, 1, x - center, center, Gsize * 2, Gsize * 2);
+ for(opacity = 0; opacity < 25; opacity++)
+ shadowTop[opacity * (Gsize + 1) + x] = shadowTop[25 * (Gsize + 1) + x] * opacity / 25;
+ for(y = 0; y <= x; y++)
+ {
+ shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x]
+ = sum_gaussian (map, 1, x - center, y - center, Gsize * 2, Gsize * 2);
+ shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + x * (Gsize + 1) + y]
+ = shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x];
+ for(opacity = 0; opacity < 25; opacity++)
+ shadowCorner[opacity * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x]
+ = shadowCorner[opacity * (Gsize + 1) * (Gsize + 1) + x * (Gsize + 1) + y]
+ = shadowCorner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x] * opacity / 25;
+ }
+ }
+}
+
static XImage *
make_shadow (Display *dpy, double opacity, int width, int height)
{
int x, y;
unsigned char d;
int x_diff;
-
+ int opacity_int = (int)(opacity * 25);
data = malloc (swidth * sheight * sizeof (unsigned char));
if (!data)
return 0;
/*
* center (fill the complete data array)
*/
-
- d = sum_gaussian (gaussianMap, opacity, center, center, width, height);
+ if (Gsize > 0)
+ d = shadowTop[opacity_int * (Gsize + 1) + Gsize];
+ else
+ d = sum_gaussian (gaussianMap, opacity, center, center, width, height);
memset(data, d, sheight * swidth);
/*
for (y = 0; y < ylimit; y++)
for (x = 0; x < xlimit; x++)
{
- d = sum_gaussian (gaussianMap, opacity, x - center, y - center, width, height);
+ if (xlimit == Gsize && ylimit == Gsize)
+ d = shadowCorner[opacity_int * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x];
+ else
+ d = sum_gaussian (gaussianMap, opacity, x - center, y - center, width, height);
data[y * swidth + x] = d;
data[(sheight - y - 1) * swidth + x] = d;
data[(sheight - y - 1) * swidth + (swidth - x - 1)] = d;
{
for (y = 0; y < ylimit; y++)
{
- d = sum_gaussian (gaussianMap, opacity, center, y - center, width, height);
+ if (ylimit == Gsize)
+ d = shadowTop[opacity_int * (Gsize + 1) + y];
+ else
+ d = sum_gaussian (gaussianMap, opacity, center, y - center, width, height);
memset (&data[y * swidth + gsize], d, x_diff);
memset (&data[(sheight - y - 1) * swidth + gsize], d, x_diff);
}
for (x = 0; x < xlimit; x++)
{
- d = sum_gaussian (gaussianMap, opacity, x - center, center, width, height);
+ if (xlimit == Gsize)
+ d = shadowTop[opacity_int * (Gsize + 1) + x];
+ else
+ d = sum_gaussian (gaussianMap, opacity, x - center, center, width, height);
for (y = gsize; y < sheight - gsize; y++)
{
data[y * swidth + x] = d;
}
static Picture
-shadow_picture (Display *dpy, double opacity, int width, int height, int *wp, int *hp)
+shadow_picture (Display *dpy, double opacity, Picture alpha_pict, int width, int height, int *wp, int *hp)
{
XImage *shadowImage;
Pixmap shadowPixmap;
shadowImage->width,
shadowImage->height,
8);
+ if (!shadowPixmap)
+ {
+ XDestroyImage (shadowImage);
+ return None;
+ }
+
shadowPicture = XRenderCreatePicture (dpy, shadowPixmap,
XRenderFindStandardFormat (dpy, PictStandardA8),
0, 0);
+ if (!shadowPicture)
+ {
+ XDestroyImage (shadowImage);
+ XFreePixmap (dpy, shadowPixmap);
+ return None;
+ }
+
gc = XCreateGC (dpy, shadowPixmap, 0, 0);
+ if (!gc)
+ {
+ XDestroyImage (shadowImage);
+ XFreePixmap (dpy, shadowPixmap);
+ XRenderFreePicture (dpy, shadowPicture);
+ return None;
+ }
XPutImage (dpy, shadowPixmap, gc, shadowImage, 0, 0, 0, 0,
shadowImage->width,
XRenderColor c;
pixmap = XCreatePixmap (dpy, root, 1, 1, argb ? 32 : 8);
+ if (!pixmap)
+ return None;
+
pa.repeat = True;
picture = XRenderCreatePicture (dpy, pixmap,
XRenderFindStandardFormat (dpy, argb ? PictStandardARGB32 : PictStandardA8),
CPRepeat,
&pa);
+ if (!picture)
+ {
+ XFreePixmap (dpy, pixmap);
+ return None;
+ }
+
c.alpha = a * 0xffff;
c.red = r * 0xffff;
c.green = g * 0xffff;
r.y = w->a.y;
r.width = w->a.width + w->a.border_width * 2;
r.height = w->a.height + w->a.border_width * 2;
- if (compMode != CompSimple)
+ if (compMode != CompSimple && !(w->windowType == winDockAtom && excludeDockShadows))
{
if (compMode == CompServerShadows || w->mode != WINDOW_ARGB)
{
}
else
{
- w->shadow_dx = SHADOW_OFFSET_X;
- w->shadow_dy = SHADOW_OFFSET_Y;
+ w->shadow_dx = shadowOffsetX;
+ w->shadow_dy = shadowOffsetY;
if (!w->shadow)
{
- double opacity = SHADOW_OPACITY;
+ double opacity = shadowOpacity;
if (w->mode == WINDOW_TRANS)
- opacity = opacity * TRANS_OPACITY;
- w->shadow = shadow_picture (dpy, opacity,
+ opacity = opacity * ((double)w->opacity)/((double)OPAQUE);
+ w->shadow = shadow_picture (dpy, opacity, w->alphaPict,
w->a.width + w->a.border_width * 2,
w->a.height + w->a.border_width * 2,
&w->shadow_width, &w->shadow_height);
/* never painted, ignore it */
if (!w->damaged)
continue;
+ /* if invisible, ignore it */
+ if (w->a.x + w->a.width < 1 || w->a.y + w->a.height < 1
+ || w->a.x >= root_width || w->a.y >= root_height)
+ continue;
if (!w->picture)
{
XRenderPictureAttributes pa;
case CompSimple:
break;
case CompServerShadows:
+ /* dont' bother drawing shadows on desktop windows */
+ if (w->windowType == winDesktopAtom)
+ break;
set_ignore (dpy, NextRequest (dpy));
if (w->opacity != OPAQUE && !w->shadowPict)
w->shadowPict = solid_picture (dpy, True,
w->shadow_width, w->shadow_height);
break;
case CompClientShadows:
- if (w->shadow)
+ /* don't bother drawing shadows on desktop windows */
+ if (w->shadow && w->windowType != winDesktopAtom)
{
XRenderComposite (dpy, PictOpOver, blackPicture, w->shadow, rootBuffer,
0, 0, 0, 0,
w->damaged = 1;
}
+static unsigned int
+get_opacity_prop (Display *dpy, win *w, unsigned int def);
+
static void
map_win (Display *dpy, Window id, unsigned long sequence, Bool fade)
{
win *w = find_win (dpy, id);
- Drawable back;
if (!w)
return;
+
w->a.map_state = IsViewable;
+ /* This needs to be here or else we lose transparency messages */
+ XSelectInput (dpy, id, PropertyChangeMask);
+
+ /* This needs to be here since we don't get PropertyNotify when unmapped */
+ w->opacity = get_opacity_prop (dpy, w, OPAQUE);
+ determine_mode (dpy, w);
+
#if CAN_DO_USABLE
w->damage_bounds.x = w->damage_bounds.y = 0;
w->damage_bounds.width = w->damage_bounds.height = 0;
#endif
w->damaged = 0;
+
+ if (fade && fadeWindows)
+ set_fade (dpy, w, 0, get_opacity_percent (dpy, w, 1.0), fade_in_step, 0, False, True, True);
}
static void
win *w = find_win (dpy, id);
if (!w)
return;
+ w->a.map_state = IsUnmapped;
#if HAS_NAME_WINDOW_PIXMAP
if (w->pixmap && fade && fadeWindows)
- set_fade (dpy, w, False, unmap_callback, False);
+ set_fade (dpy, w, w->opacity*1.0/OPAQUE, 0.0, fade_out_step, unmap_callback, False, False, True);
else
#endif
finish_unmap_win (dpy, w);
int format;
unsigned long n, left;
- char *data;
- XGetWindowProperty(dpy, w->id, opacityAtom, 0L, 1L, False,
+ unsigned char *data;
+ int result = XGetWindowProperty(dpy, w->id, opacityAtom, 0L, 1L, False,
XA_CARDINAL, &actual, &format,
- &n, &left, (unsigned char **) &data);
- if (data != None)
+ &n, &left, &data);
+ if (result == Success && data != NULL)
{
unsigned int i;
memcpy (&i, data, sizeof (unsigned int));
return def;
}
+/* Get the opacity property from the window in a percent format
+ not found: default
+ otherwise: the value
+*/
+static double
+get_opacity_percent(Display *dpy, win *w, double def)
+{
+ unsigned int opacity = get_opacity_prop (dpy, w, (unsigned int)(OPAQUE*def));
+
+ return opacity*1.0/OPAQUE;
+}
+
/* determine mode for window all in one place.
Future might check for menu flag and other cool things
*/
+static Atom
+get_wintype_prop(Display * dpy, Window w)
+{
+ Atom actual;
+ int format;
+ unsigned long n, left;
+
+ unsigned char *data;
+ int result = XGetWindowProperty (dpy, w, winTypeAtom, 0L, 1L, False,
+ XA_ATOM, &actual, &format,
+ &n, &left, &data);
+
+ if (result == Success && data != None)
+ {
+ Atom a;
+ memcpy (&a, data, sizeof (Atom));
+ XFree ( (void *) data);
+ return a;
+ }
+ return winNormalAtom;
+}
+
static void
determine_mode(Display *dpy, win *w)
{
int mode;
XRenderPictFormat *format;
- unsigned int default_opacity;
/* if trans prop == -1 fall back on previous tests*/
}
}
+static Atom
+determine_wintype (Display *dpy, Window w)
+{
+ Window root_return, parent_return;
+ Window *children = NULL;
+ unsigned int nchildren, i;
+ Atom type;
+
+ type = get_wintype_prop (dpy, w);
+ if (type != winNormalAtom)
+ return type;
+
+ if (!XQueryTree (dpy, w, &root_return, &parent_return, &children,
+ &nchildren))
+ {
+ /* XQueryTree failed. */
+ if (children)
+ XFree ((void *)children);
+ return winNormalAtom;
+ }
+
+ for (i = 0;i < nchildren;i++)
+ {
+ type = determine_wintype (dpy, children[i]);
+ if (type != winNormalAtom)
+ return type;
+ }
+
+ if (children)
+ XFree ((void *)children);
+
+ return winNormalAtom;
+}
+
static void
add_win (Display *dpy, Window id, Window prev)
{
new->borderClip = None;
new->prev_trans = 0;
- /* moved mode setting to one place */
- XSelectInput(dpy, id, PropertyChangeMask);
- new->opacity = get_opacity_prop(dpy, new, OPAQUE);
- determine_mode (dpy, new);
+ new->windowType = determine_wintype (dpy, new->id);
new->next = *p;
*p = new;
if (new->a.map_state == IsViewable)
- map_win (dpy, id, new->damage_sequence - 1, False);
+ map_win (dpy, id, new->damage_sequence - 1, True);
}
void
configure_win (Display *dpy, XConfigureEvent *ce)
{
win *w = find_win (dpy, ce->window);
- Window above;
XserverRegion damage = None;
if (!w)
win *w = find_win (dpy, ce->window);
Window new_above;
+ if (!w)
+ return;
+
if (ce->place == PlaceOnTop)
new_above = list->id;
else
for (prev = &list; (w = *prev); prev = &w->next)
if (w->id == id)
{
- if (!gone)
+ if (gone)
finish_unmap_win (dpy, w);
*prev = w->next;
if (w->picture)
{
set_ignore (dpy, NextRequest (dpy));
XRenderFreePicture (dpy, w->picture);
+ w->picture = None;
}
if (w->alphaPict)
{
{
set_ignore (dpy, NextRequest (dpy));
XDamageDestroy (dpy, w->damage);
+ w->damage = None;
}
cleanup_fade (dpy, w);
free (w);
win *w = find_win (dpy, id);
#if HAS_NAME_WINDOW_PIXMAP
if (w && w->pixmap && fade && fadeWindows)
- set_fade (dpy, w, False, destroy_callback, gone);
+ set_fade (dpy, w, w->opacity*1.0/OPAQUE, 0.0, fade_out_step, destroy_callback, gone, False, True);
else
#endif
{
{
clipChanged = True;
if (fadeWindows)
- set_fade (dpy, w, True, 0, False);
+ set_fade (dpy, w, 0, get_opacity_percent (dpy, w, 1.0), fade_in_step, 0, False, True, True);
w->usable = True;
}
}
default: break;
}
- printf ("error %d request %d minor %d serial %d\n",
+ printf ("error %d request %d minor %d serial %lu\n",
ev->error_code, ev->request_code, ev->minor_code, ev->serial);
/* abort (); this is just annoying to most people */
add_damage (dpy, region);
}
-
+#if DEBUG_EVENTS
static int
ev_serial (XEvent *ev)
{
return NextRequest (ev->xany.display);
}
-
static char *
ev_name (XEvent *ev)
{
return 0;
}
}
+#endif
void
usage (char *program)
{
- fprintf (stderr, "usage: %s [-d display] [-n] [-s] [-c] [-a]\n", program);
+ fprintf (stderr, "%s v1.1.3\n", program);
+ fprintf (stderr, "usage: %s [options]\n", program);
+ fprintf (stderr, "Options\n");
+ fprintf (stderr, " -d display\n Specifies which display should be managed.\n");
+ fprintf (stderr, " -r radius\n Specifies the blur radius for client-side shadows. (default 12)\n");
+ fprintf (stderr, " -o opacity\n Specifies the translucency for client-side shadows. (default .75)\n");
+ fprintf (stderr, " -l left-offset\n Specifies the left offset for client-side shadows. (default -15)\n");
+ fprintf (stderr, " -t top-offset\n Specifies the top offset for clinet-side shadows. (default -15)\n");
+ fprintf (stderr, " -I fade-in-step\n Specifies the opacity change between steps while fading in. (default 0.028)\n");
+ fprintf (stderr, " -O fade-out-step\n Specifies the opacity change between steps while fading out. (default 0.03)\n");
+ fprintf (stderr, " -D fade-delta-time\n Specifies the time between steps in a fade in milliseconds. (default 10)\n");
+ fprintf (stderr, " -a\n Use automatic server-side compositing. Faster, but no special effects.\n");
+ fprintf (stderr, " -c\n Draw client-side shadows with fuzzy edges.\n");
+ fprintf (stderr, " -C\n Avoid drawing shadows on dock/panel windows.\n");
+ fprintf (stderr, " -f\n Fade windows in/out when opening/closing.\n");
+ fprintf (stderr, " -F\n Fade windows during opacity changes.\n");
+ fprintf (stderr, " -n\n Normal client-side compositing with transparency support\n");
+ fprintf (stderr, " -s\n Draw server-side shadows with sharp edges.\n");
+ fprintf (stderr, " -S\n Enable synchronous operation (for debugging).\n");
exit (1);
}
+static void
+register_cm (void)
+{
+ Window w;
+ Atom a;
+
+ w = XCreateSimpleWindow (dpy, RootWindow (dpy, 0), 0, 0, 1, 1, 0, None,
+ None);
+
+ Xutf8SetWMProperties (dpy, w, "xcompmgr", "xcompmgr", NULL, 0, NULL, NULL,
+ NULL);
+
+ /* FIXME: Don't hard code the screen number */
+ a = XInternAtom (dpy, "_NET_WM_CM_S0", False);
+
+ XSetSelectionOwner (dpy, a, w, 0);
+}
+
int
main (int argc, char **argv)
{
XEvent ev;
Window root_return, parent_return;
Window *children;
- Pixmap transPixmap;
- Pixmap blackPixmap;
unsigned int nchildren;
int i;
XRenderPictureAttributes pa;
- XRenderColor c;
XRectangle *expose_rects = 0;
int size_expose = 0;
int n_expose = 0;
struct pollfd ufd;
- int n;
- int last_update;
- int now;
int p;
int composite_major, composite_minor;
char *display = 0;
int o;
- while ((o = getopt (argc, argv, "d:scnfaS")) != -1)
+ while ((o = getopt (argc, argv, "D:I:O:d:r:o:l:t:scnfFCaS")) != -1)
{
switch (o) {
case 'd':
display = optarg;
break;
+ case 'D':
+ fade_delta = atoi (optarg);
+ if (fade_delta < 1)
+ fade_delta = 10;
+ break;
+ case 'I':
+ fade_in_step = atof (optarg);
+ if (fade_in_step <= 0)
+ fade_in_step = 0.01;
+ break;
+ case 'O':
+ fade_out_step = atof (optarg);
+ if (fade_out_step <= 0)
+ fade_out_step = 0.01;
+ break;
case 's':
compMode = CompServerShadows;
break;
case 'c':
compMode = CompClientShadows;
break;
+ case 'C':
+ excludeDockShadows = True;
+ break;
case 'n':
compMode = CompSimple;
break;
case 'f':
fadeWindows = True;
break;
+ case 'F':
+ fadeTrans = True;
+ break;
case 'a':
autoRedirect = True;
break;
case 'S':
synchronize = True;
break;
+ case 'r':
+ shadowRadius = atoi (optarg);
+ break;
+ case 'o':
+ shadowOpacity = atof (optarg);
+ break;
+ case 'l':
+ shadowOffsetX = atoi (optarg);
+ break;
+ case 't':
+ shadowOffsetY = atoi (optarg);
+ break;
default:
usage (argv[0]);
break;
fprintf (stderr, "No XFixes extension\n");
exit (1);
}
+
+ register_cm();
+
/* get atoms */
opacityAtom = XInternAtom (dpy, OPACITY_PROP, False);
+ winTypeAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE", False);
+ winDesktopAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False);
+ winDockAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DOCK", False);
+ winToolbarAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_TOOLBAR", False);
+ winMenuAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_MENU", False);
+ winUtilAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_UTILITY", False);
+ winSplashAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_SPLASH", False);
+ winDialogAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
+ winNormalAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_NORMAL", False);
pa.subwindow_mode = IncludeInferiors;
if (compMode == CompClientShadows)
+ {
gaussianMap = make_gaussian_map(dpy, shadowRadius);
+ presum_gaussian (gaussianMap);
+ }
root_width = DisplayWidth (dpy, scr);
root_height = DisplayHeight (dpy, scr);
}
XNextEvent (dpy, &ev);
- if (ev.type & 0x7f != KeymapNotify)
+ if ((ev.type & 0x7f) != KeymapNotify)
discard_ignore (dpy, ev.xany.serial);
#if DEBUG_EVENTS
printf ("event %10.10s serial 0x%08x window 0x%08x\n",
win * w = find_win(dpy, ev.xproperty.window);
if (w)
{
+ if (fadeTrans)
+ set_fade (dpy, w, w->opacity*1.0/OPAQUE, get_opacity_percent (dpy, w, 1.0),
+ fade_out_step, 0, False, True, False);
+ else
+ {
w->opacity = get_opacity_prop(dpy, w, OPAQUE);
determine_mode(dpy, w);
+ if (w->shadow)
+ {
+ XRenderFreePicture (dpy, w->shadow);
+ w->shadow = None;
+ w->extents = win_extents (dpy, w);
+ }
+ }
}
}
break;