diff options
Diffstat (limited to '')
-rw-r--r-- | xcompmgr.c | 104 |
1 files changed, 52 insertions, 52 deletions
@@ -21,7 +21,7 @@ */ -/* Modified by Matthew Hawn. I don't know what to say here so follow what it +/* Modified by Matthew Hawn. I don't know what to say here so follow what it says above. Not that I can really do anything about it */ @@ -170,7 +170,7 @@ typedef enum _compMode { static void determine_mode(Display *dpy, win *w); - + static double get_opacity_percent(Display *dpy, win *w, double def); @@ -212,7 +212,7 @@ static fade * find_fade (win *w) { fade *f; - + for (f = fades; f; f = f->next) { if (f->w == w) @@ -395,7 +395,7 @@ make_gaussian_map (Display *dpy, double r) int x, y; double t; double g; - + c = malloc (sizeof (conv) + size * size * sizeof (double)); c->size = size; c->data = (double *) (c + 1); @@ -432,7 +432,7 @@ make_gaussian_map (Display *dpy, double r) * height+ | | | | * center +-----+-------------------+-----+ */ - + static unsigned char sum_gaussian (conv *map, double opacity, int x, int y, int width, int height) { @@ -444,7 +444,7 @@ sum_gaussian (conv *map, double opacity, int x, int y, int width, int height) int fx_start, fx_end; int fy_start, fy_end; double v; - + /* * Compute set of filter values which are "in range", * that's the set with: @@ -470,19 +470,19 @@ sum_gaussian (conv *map, double opacity, int x, int y, int width, int height) fy_end = g_size; g_line = g_line + fy_start * g_size + fx_start; - + v = 0; for (fy = fy_start; fy < fy_end; fy++) { g_data = g_line; g_line += g_size; - + for (fx = fx_start; fx < fx_end; fx++) v += *g_data++; } if (v > 1) v = 1; - + return ((unsigned char) (v * opacity * 255.0)); } @@ -502,7 +502,7 @@ presum_gaussian (conv *map) 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); @@ -563,7 +563,7 @@ make_shadow (Display *dpy, double opacity, int width, int height) else d = sum_gaussian (gaussianMap, opacity, center, center, width, height); memset(data, d, sheight * swidth); - + /* * corners */ @@ -607,7 +607,7 @@ make_shadow (Display *dpy, double opacity, int width, int height) /* * sides */ - + for (x = 0; x < xlimit; x++) { if (xlimit == Gsize) @@ -631,11 +631,11 @@ shadow_picture (Display *dpy, double opacity, Picture alpha_pict, int width, int Pixmap shadowPixmap; Picture shadowPicture; GC gc; - + shadowImage = make_shadow (dpy, opacity, width, height); if (!shadowImage) return None; - shadowPixmap = XCreatePixmap (dpy, root, + shadowPixmap = XCreatePixmap (dpy, root, shadowImage->width, shadowImage->height, 8); @@ -663,8 +663,8 @@ shadow_picture (Display *dpy, double opacity, Picture alpha_pict, int width, int XRenderFreePicture (dpy, shadowPicture); return (Picture)None; } - - XPutImage (dpy, shadowPixmap, gc, shadowImage, 0, 0, 0, 0, + + XPutImage (dpy, shadowPixmap, gc, shadowImage, 0, 0, 0, 0, shadowImage->width, shadowImage->height); *wp = shadowImage->width; @@ -760,7 +760,7 @@ static const char *backgroundProps[] = { "_XSETROOT_ID", NULL, }; - + static Picture root_tile (Display *dpy) { @@ -802,10 +802,10 @@ root_tile (Display *dpy) if (fill) { XRenderColor c; - + c.red = c.green = c.blue = 0x8080; c.alpha = 0xffff; - XRenderFillRectangle (dpy, PictOpSrc, picture, &c, + XRenderFillRectangle (dpy, PictOpSrc, picture, &c, 0, 0, 1, 1); } return picture; @@ -816,7 +816,7 @@ paint_root (Display *dpy) { if (!rootTile) rootTile = root_tile (dpy); - + XRenderComposite (dpy, PictOpSrc, rootTile, None, rootBuffer, 0, 0, 0, 0, 0, 0, root_width, root_height); @@ -826,7 +826,7 @@ static XserverRegion win_extents (Display *dpy, win *w) { XRectangle r; - + r.x = w->a.x; r.y = w->a.y; r.width = w->a.width + w->a.border_width * 2; @@ -908,7 +908,7 @@ paint_all (Display *dpy, XserverRegion region) { win *w; win *t = NULL; - + if (!region) { XRectangle r; @@ -958,7 +958,7 @@ paint_all (Display *dpy, XserverRegion region) XRenderPictureAttributes pa; XRenderPictFormat *format; Drawable draw = w->id; - + #if HAS_NAME_WINDOW_PIXMAP if (hasNamePixmap && !w->pixmap) w->pixmap = XCompositeNameWindowPixmap (dpy, w->id); @@ -1017,7 +1017,7 @@ paint_all (Display *dpy, XserverRegion region) XFixesSubtractRegion (dpy, region, region, w->borderSize); set_ignore (dpy, NextRequest (dpy)); XRenderComposite (dpy, PictOpSrc, w->picture, None, rootBuffer, - 0, 0, 0, 0, + 0, 0, 0, 0, x, y, wid, hei); } if (!w->borderClip) @@ -1049,7 +1049,7 @@ paint_all (Display *dpy, XserverRegion region) w->shadowPict = solid_picture (dpy, True, (double) w->opacity / OPAQUE * 0.3, 0, 0, 0); - XRenderComposite (dpy, PictOpOver, + XRenderComposite (dpy, PictOpOver, w->shadowPict ? w->shadowPict : transBlackPicture, w->picture, rootBuffer, 0, 0, 0, 0, @@ -1070,7 +1070,7 @@ paint_all (Display *dpy, XserverRegion region) break; } if (w->opacity != OPAQUE && !w->alphaPict) - w->alphaPict = solid_picture (dpy, False, + w->alphaPict = solid_picture (dpy, False, (double) w->opacity / OPAQUE, 0, 0, 0); if (w->mode == WINDOW_TRANS) { @@ -1088,7 +1088,7 @@ paint_all (Display *dpy, XserverRegion region) #endif set_ignore (dpy, NextRequest (dpy)); XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer, - 0, 0, 0, 0, + 0, 0, 0, 0, x, y, wid, hei); } else if (w->mode == WINDOW_ARGB) @@ -1107,7 +1107,7 @@ paint_all (Display *dpy, XserverRegion region) #endif set_ignore (dpy, NextRequest (dpy)); XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer, - 0, 0, 0, 0, + 0, 0, 0, 0, x, y, wid, hei); } XFixesDestroyRegion (dpy, w->borderClip); @@ -1179,7 +1179,7 @@ map_win (Display *dpy, Window id, unsigned long sequence, Bool fade) return; w->a.map_state = IsViewable; - + /* This needs to be here or else we lose transparency messages */ XSelectInput (dpy, id, PropertyChangeMask); @@ -1209,7 +1209,7 @@ finish_unmap_win (Display *dpy, win *w) add_damage (dpy, w->extents); /* destroys region */ w->extents = None; } - + #if HAS_NAME_WINDOW_PIXMAP if (w->pixmap) { @@ -1284,8 +1284,8 @@ get_opacity_prop(Display *dpy, win *w, unsigned int def) unsigned long n, left; unsigned char *data; - int result = XGetWindowProperty(dpy, w->id, opacityAtom, 0L, 1L, False, - XA_CARDINAL, &actual, &format, + int result = XGetWindowProperty(dpy, w->id, opacityAtom, 0L, 1L, False, + XA_CARDINAL, &actual, &format, &n, &left, &data); if (result == Success && data != NULL) { @@ -1424,7 +1424,7 @@ add_win (Display *dpy, Window id, Window prev) { win *new = malloc (sizeof (win)); win **p; - + if (!new) return; if (prev) @@ -1475,7 +1475,7 @@ add_win (Display *dpy, Window id, Window prev) new->prev_trans = NULL; new->windowType = determine_wintype (dpy, new->id); - + new->next = *p; *p = new; if (new->a.map_state == IsViewable) @@ -1486,7 +1486,7 @@ static void restack_win (Display *dpy, win *w, Window new_above) { Window old_above; - + if (w->next) old_above = w->next->id; else @@ -1500,7 +1500,7 @@ restack_win (Display *dpy, win *w, Window new_above) if ((*prev) == w) break; *prev = w->next; - + /* rehook */ for (prev = &list; *prev; prev = &(*prev)->next) { @@ -1517,7 +1517,7 @@ configure_win (Display *dpy, XConfigureEvent *ce) { win *w = find_win (dpy, ce->window); XserverRegion damage = None; - + if (!w) { if (ce->window == root) @@ -1537,7 +1537,7 @@ configure_win (Display *dpy, XConfigureEvent *ce) #endif { damage = XFixesCreateRegion (dpy, NULL, 0); - if (w->extents != None) + if (w->extents != None) XFixesCopyRegion (dpy, damage, w->extents); } w->a.x = ce->x; @@ -1722,7 +1722,7 @@ damage_win (Display *dpy, XDamageNotifyEvent *de) w->damage_bounds.width, w->damage_bounds.height); #endif - if (w->damage_bounds.x <= 0 && + if (w->damage_bounds.x <= 0 && w->damage_bounds.y <= 0 && w->a.width <= w->damage_bounds.x + w->damage_bounds.width && w->a.height <= w->damage_bounds.y + w->damage_bounds.height) @@ -1744,17 +1744,17 @@ error (Display *dpy, XErrorEvent *ev) int o; const char *name = NULL; static char buffer[256]; - + if (should_ignore (dpy, ev->serial)) return 0; - + if (ev->request_code == composite_opcode && ev->minor_code == X_CompositeRedirectSubwindows) { fprintf (stderr, "Another composite manager is already running\n"); exit (1); } - + o = ev->error_code - xfixes_error; switch (o) { case BadRegion: name = "BadRegion"; break; @@ -1794,7 +1794,7 @@ static void expose_root (Display *dpy, Window root, XRectangle *rects, int nrects) { XserverRegion region = XFixesCreateRegion (dpy, rects, nrects); - + add_damage (dpy, region); } @@ -1894,7 +1894,7 @@ register_cm (void) char **strs; int count; Atom winNameAtom = XInternAtom (dpy, "_NET_WM_NAME", False); - + if (!XGetTextProperty (dpy, w, &tp, winNameAtom) && !XGetTextProperty (dpy, w, &tp, XA_WM_NAME)) { @@ -1903,12 +1903,12 @@ register_cm (void) (unsigned long) w); return False; } - if (XmbTextPropertyToTextList (dpy, &tp, &strs, &count) == Success) + if (XmbTextPropertyToTextList (dpy, &tp, &strs, &count) == Success) { - fprintf (stderr, + fprintf (stderr, "Another composite manager is already running (%s)\n", strs[0]); - + XFreeStringList (strs); } @@ -2008,7 +2008,7 @@ main (int argc, char **argv) break; } } - + dpy = XOpenDisplay (display); if (!dpy) { @@ -2077,7 +2077,7 @@ main (int argc, char **argv) root_width = DisplayWidth (dpy, scr); root_height = DisplayHeight (dpy, scr); - rootPicture = XRenderCreatePicture (dpy, root, + rootPicture = XRenderCreatePicture (dpy, root, XRenderFindVisualFormat (dpy, DefaultVisual (dpy, scr)), CPSubwindowMode, @@ -2093,7 +2093,7 @@ main (int argc, char **argv) else { XCompositeRedirectSubwindows (dpy, root, CompositeRedirectManual); - XSelectInput (dpy, root, + XSelectInput (dpy, root, SubstructureNotifyMask| ExposureMask| StructureNotifyMask| @@ -2163,8 +2163,8 @@ main (int argc, char **argv) { if (expose_rects) { - expose_rects = realloc (expose_rects, - (size_expose + more) * + expose_rects = realloc (expose_rects, + (size_expose + more) * sizeof (XRectangle)); size_expose += more; } |