From b87efad014e185ce836746617d112c07b53ed8ee Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 6 Nov 2011 19:29:23 -0600 Subject: [PATCH] fix gcc warning, have shadows be explicitly enabled --- README.md | 3 +-- compton.c | 28 ++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 68d36a24..73139e95 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ partially doing this out of a desire to learn Xlib. * __inactive window transparency__ (specified with `-i`) * __titlebar/frame transparency__ (specified with `-e`) +* menu transparency (thanks to Dana) * shadows are now enabled for argb windows, e.g. terminals with transparency * removed serverside shadows (and simple compositing) to clean the code, the only option that remains is clientside shadows -* menu transparency (thanks to Dana) The above features give compton a feature set similar to the xfce compositor. @@ -55,7 +55,6 @@ The same dependencies and build as xcompmgr. * libxdamage * libxfixes * libxrender -* autoconf To build, make sure you have the above dependencies: diff --git a/compton.c b/compton.c index 66261e41..393c3637 100644 --- a/compton.c +++ b/compton.c @@ -987,7 +987,10 @@ find_client_win(Display *dpy, Window win) { static void get_frame_extents(Display *dpy, Window w, - int *left, int *right, int *top, int *bottom) { + unsigned int *left, + unsigned int *right, + unsigned int *top, + unsigned int *bottom) { long *extents; Atom type; int format; @@ -1012,10 +1015,14 @@ get_frame_extents(Display *dpy, Window w, if (result == Success) { if (nitems == 4 && after == 0) { extents = (long *)data; - *left = (int) *extents; - *right = (int) *(extents + 1); - *top = (int) *(extents + 2); - *bottom = (int) *(extents + 3); + *left = + (unsigned int)extents[0]; + *right = + (unsigned int)extents[1]; + *top = + (unsigned int)extents[2]; + *bottom = + (unsigned int)extents[3]; } XFree(data); } @@ -2216,7 +2223,7 @@ main(int argc, char **argv) { for (i = 0; i < NUM_WINTYPES; ++i) { win_type_fade[i] = False; - win_type_shadow[i] = True; + win_type_shadow[i] = False; win_type_opacity[i] = 1.0; } @@ -2246,6 +2253,11 @@ main(int argc, char **argv) { fade_out_step = 0.01; } break; + case 'c': + for (i = 0; i < NUM_WINTYPES; ++i) { + win_type_shadow[i] = True; + } + break; case 'C': no_dock_shadow = True; break; @@ -2282,11 +2294,11 @@ main(int argc, char **argv) { case 'e': frame_opacity = (double)atof(optarg); break; - case 'c': case 'n': case 'a': case 's': - /* legacy */ + fprintf(stderr, "Warning: " + "-n, -a, and -s have been removed.\n"); break; default: usage(argv[0]);