more whitespace
This commit is contained in:
parent
7d17fcdf1e
commit
c50fdf4fd4
419
xcompmgr.c
419
xcompmgr.c
@ -80,8 +80,8 @@ typedef struct _win {
|
|||||||
#endif
|
#endif
|
||||||
XWindowAttributes a;
|
XWindowAttributes a;
|
||||||
#if CAN_DO_USABLE
|
#if CAN_DO_USABLE
|
||||||
Bool usable; /* mapped and all damaged at one point */
|
Bool usable; /* mapped and all damaged at one point */
|
||||||
XRectangle damage_bounds; /* bounds of damage */
|
XRectangle damage_bounds; /* bounds of damage */
|
||||||
#endif
|
#endif
|
||||||
int mode;
|
int mode;
|
||||||
int damaged;
|
int damaged;
|
||||||
@ -98,7 +98,7 @@ typedef struct _win {
|
|||||||
int shadow_height;
|
int shadow_height;
|
||||||
unsigned int opacity;
|
unsigned int opacity;
|
||||||
wintype window_type;
|
wintype window_type;
|
||||||
unsigned long damage_sequence; /* sequence when damage was created */
|
unsigned long damage_sequence; /* sequence when damage was created */
|
||||||
Bool destroyed;
|
Bool destroyed;
|
||||||
|
|
||||||
Bool need_configure;
|
Bool need_configure;
|
||||||
@ -300,9 +300,11 @@ set_fade(Display *dpy, win *w, double start,
|
|||||||
w->extents = win_extents(dpy, w);
|
w->extents = win_extents(dpy, w);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fading windows need to be drawn, mark them as damaged.
|
/* fading windows need to be drawn, mark
|
||||||
when a window maps, if it tries to fade in but it already at the right
|
them as damaged. when a window maps,
|
||||||
opacity (map/unmap/map fast) then it will never get drawn without this
|
if it tries to fade in but it already
|
||||||
|
at the right opacity (map/unmap/map fast)
|
||||||
|
then it will never get drawn without this
|
||||||
until it repaints */
|
until it repaints */
|
||||||
w->damaged = 1;
|
w->damaged = 1;
|
||||||
}
|
}
|
||||||
@ -357,12 +359,12 @@ run_fades(Display *dpy) {
|
|||||||
need_dequeue = False;
|
need_dequeue = False;
|
||||||
if (f->step > 0) {
|
if (f->step > 0) {
|
||||||
if (f->cur >= f->finish) {
|
if (f->cur >= f->finish) {
|
||||||
w->opacity = f->finish*OPAQUE;
|
w->opacity = f->finish * OPAQUE;
|
||||||
need_dequeue = True;
|
need_dequeue = True;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (f->cur <= f->finish) {
|
if (f->cur <= f->finish) {
|
||||||
w->opacity = f->finish*OPAQUE;
|
w->opacity = f->finish * OPAQUE;
|
||||||
need_dequeue = True;
|
need_dequeue = True;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -381,7 +383,8 @@ run_fades(Display *dpy) {
|
|||||||
w->extents = win_extents(dpy, w);
|
w->extents = win_extents(dpy, w);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Must do this last as it might destroy f->w in callbacks */
|
/* Must do this last as it might
|
||||||
|
destroy f->w in callbacks */
|
||||||
if (need_dequeue) dequeue_fade(dpy, f);
|
if (need_dequeue) dequeue_fade(dpy, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,7 +449,8 @@ make_gaussian_map(Display *dpy, double r) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static unsigned char
|
static unsigned char
|
||||||
sum_gaussian(conv *map, double opacity, int x, int y, int width, int height) {
|
sum_gaussian(conv *map, double opacity,
|
||||||
|
int x, int y, int width, int height) {
|
||||||
int fx, fy;
|
int fx, fy;
|
||||||
double *g_data;
|
double *g_data;
|
||||||
double *g_line = map->data;
|
double *g_line = map->data;
|
||||||
@ -494,7 +498,8 @@ sum_gaussian(conv *map, double opacity, int x, int y, int width, int height) {
|
|||||||
return ((unsigned char) (v * opacity * 255.0));
|
return ((unsigned char) (v * opacity * 255.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* precompute shadow corners and sides to save time for large windows */
|
/* precompute shadow corners and sides
|
||||||
|
to save time for large windows */
|
||||||
static void
|
static void
|
||||||
presum_gaussian(conv *map) {
|
presum_gaussian(conv *map) {
|
||||||
int center = map->size/2;
|
int center = map->size/2;
|
||||||
@ -524,16 +529,20 @@ presum_gaussian(conv *map) {
|
|||||||
= shadow_corner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x];
|
= shadow_corner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x];
|
||||||
|
|
||||||
for (opacity = 0; opacity < 25; opacity++) {
|
for (opacity = 0; opacity < 25; opacity++) {
|
||||||
shadow_corner[opacity * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x]
|
shadow_corner[opacity * (Gsize + 1) * (Gsize + 1)
|
||||||
= shadow_corner[opacity * (Gsize + 1) * (Gsize + 1) + x * (Gsize + 1) + y]
|
+ y * (Gsize + 1) + x]
|
||||||
= shadow_corner[25 * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x] * opacity / 25;
|
= shadow_corner[opacity * (Gsize + 1) * (Gsize + 1)
|
||||||
|
+ x * (Gsize + 1) + y]
|
||||||
|
= shadow_corner[25 * (Gsize + 1) * (Gsize + 1)
|
||||||
|
+ y * (Gsize + 1) + x] * opacity / 25;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static XImage *
|
static XImage *
|
||||||
make_shadow(Display *dpy, double opacity, int width, int height) {
|
make_shadow(Display *dpy, double opacity,
|
||||||
|
int width, int height) {
|
||||||
XImage *ximage;
|
XImage *ximage;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
int gsize = gaussian_map->size;
|
int gsize = gaussian_map->size;
|
||||||
@ -566,10 +575,12 @@ make_shadow(Display *dpy, double opacity, int width, int height) {
|
|||||||
/*
|
/*
|
||||||
* center (fill the complete data array)
|
* center (fill the complete data array)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (Gsize > 0) {
|
if (Gsize > 0) {
|
||||||
d = shadow_top[opacity_int * (Gsize + 1) + Gsize];
|
d = shadow_top[opacity_int * (Gsize + 1) + Gsize];
|
||||||
} else {
|
} else {
|
||||||
d = sum_gaussian(gaussian_map, opacity, center, center, width, height);
|
d = sum_gaussian(gaussian_map,
|
||||||
|
opacity, center, center, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(data, d, sheight * swidth);
|
memset(data, d, sheight * swidth);
|
||||||
@ -577,6 +588,7 @@ make_shadow(Display *dpy, double opacity, int width, int height) {
|
|||||||
/*
|
/*
|
||||||
* corners
|
* corners
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ylimit = gsize;
|
ylimit = gsize;
|
||||||
if (ylimit > sheight / 2) ylimit = (sheight + 1) / 2;
|
if (ylimit > sheight / 2) ylimit = (sheight + 1) / 2;
|
||||||
|
|
||||||
@ -586,9 +598,11 @@ make_shadow(Display *dpy, double opacity, int width, int height) {
|
|||||||
for (y = 0; y < ylimit; y++)
|
for (y = 0; y < ylimit; y++)
|
||||||
for (x = 0; x < xlimit; x++) {
|
for (x = 0; x < xlimit; x++) {
|
||||||
if (xlimit == Gsize && ylimit == Gsize) {
|
if (xlimit == Gsize && ylimit == Gsize) {
|
||||||
d = shadow_corner[opacity_int * (Gsize + 1) * (Gsize + 1) + y * (Gsize + 1) + x];
|
d = shadow_corner[opacity_int * (Gsize + 1) * (Gsize + 1)
|
||||||
|
+ y * (Gsize + 1) + x];
|
||||||
} else {
|
} else {
|
||||||
d = sum_gaussian(gaussian_map, opacity, x - center, y - center, width, height);
|
d = sum_gaussian(gaussian_map,
|
||||||
|
opacity, x - center, y - center, width, height);
|
||||||
}
|
}
|
||||||
data[y * swidth + x] = d;
|
data[y * swidth + x] = d;
|
||||||
data[(sheight - y - 1) * swidth + x] = d;
|
data[(sheight - y - 1) * swidth + x] = d;
|
||||||
@ -599,13 +613,15 @@ make_shadow(Display *dpy, double opacity, int width, int height) {
|
|||||||
/*
|
/*
|
||||||
* top/bottom
|
* top/bottom
|
||||||
*/
|
*/
|
||||||
|
|
||||||
x_diff = swidth - (gsize * 2);
|
x_diff = swidth - (gsize * 2);
|
||||||
if (x_diff > 0 && ylimit > 0) {
|
if (x_diff > 0 && ylimit > 0) {
|
||||||
for (y = 0; y < ylimit; y++) {
|
for (y = 0; y < ylimit; y++) {
|
||||||
if (ylimit == Gsize) {
|
if (ylimit == Gsize) {
|
||||||
d = shadow_top[opacity_int * (Gsize + 1) + y];
|
d = shadow_top[opacity_int * (Gsize + 1) + y];
|
||||||
} else {
|
} else {
|
||||||
d = sum_gaussian(gaussian_map, opacity, center, y - center, width, height);
|
d = sum_gaussian(gaussian_map,
|
||||||
|
opacity, center, y - center, width, height);
|
||||||
}
|
}
|
||||||
memset(&data[y * swidth + gsize], d, x_diff);
|
memset(&data[y * swidth + gsize], d, x_diff);
|
||||||
memset(&data[(sheight - y - 1) * swidth + gsize], d, x_diff);
|
memset(&data[(sheight - y - 1) * swidth + gsize], d, x_diff);
|
||||||
@ -620,7 +636,8 @@ make_shadow(Display *dpy, double opacity, int width, int height) {
|
|||||||
if (xlimit == Gsize) {
|
if (xlimit == Gsize) {
|
||||||
d = shadow_top[opacity_int * (Gsize + 1) + x];
|
d = shadow_top[opacity_int * (Gsize + 1) + x];
|
||||||
} else {
|
} else {
|
||||||
d = sum_gaussian(gaussian_map, opacity, x - center, center, width, height);
|
d = sum_gaussian(gaussian_map,
|
||||||
|
opacity, x - center, center, width, height);
|
||||||
}
|
}
|
||||||
for (y = gsize; y < sheight - gsize; y++) {
|
for (y = gsize; y < sheight - gsize; y++) {
|
||||||
data[y * swidth + x] = d;
|
data[y * swidth + x] = d;
|
||||||
@ -632,7 +649,8 @@ make_shadow(Display *dpy, double opacity, int width, int height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Picture
|
static Picture
|
||||||
shadow_picture(Display *dpy, double opacity, Picture alpha_pict, 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;
|
XImage *shadowImage;
|
||||||
Pixmap shadowPixmap;
|
Pixmap shadowPixmap;
|
||||||
Picture shadow_picture;
|
Picture shadow_picture;
|
||||||
@ -679,7 +697,8 @@ shadow_picture(Display *dpy, double opacity, Picture alpha_pict, int width, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
Picture
|
Picture
|
||||||
solid_picture(Display *dpy, Bool argb, double a, double r, double g, double b) {
|
solid_picture(Display *dpy, Bool argb, double a,
|
||||||
|
double r, double g, double b) {
|
||||||
Pixmap pixmap;
|
Pixmap pixmap;
|
||||||
Picture picture;
|
Picture picture;
|
||||||
XRenderPictureAttributes pa;
|
XRenderPictureAttributes pa;
|
||||||
@ -691,7 +710,8 @@ solid_picture(Display *dpy, Bool argb, double a, double r, double g, double b) {
|
|||||||
|
|
||||||
pa.repeat = True;
|
pa.repeat = True;
|
||||||
picture = XRenderCreatePicture(dpy, pixmap,
|
picture = XRenderCreatePicture(dpy, pixmap,
|
||||||
XRenderFindStandardFormat(dpy, argb ? PictStandardARGB32 : PictStandardA8),
|
XRenderFindStandardFormat(dpy, argb
|
||||||
|
? PictStandardARGB32 : PictStandardA8),
|
||||||
CPRepeat,
|
CPRepeat,
|
||||||
&pa);
|
&pa);
|
||||||
|
|
||||||
@ -835,43 +855,47 @@ win_extents(Display *dpy, win *w) {
|
|||||||
|
|
||||||
if (win_type_shadow[w->window_type]) {
|
if (win_type_shadow[w->window_type]) {
|
||||||
//if (w->mode != WINDOW_ARGB) {
|
//if (w->mode != WINDOW_ARGB) {
|
||||||
XRectangle sr;
|
XRectangle sr;
|
||||||
|
|
||||||
w->shadow_dx = shadow_offset_x;
|
w->shadow_dx = shadow_offset_x;
|
||||||
w->shadow_dy = shadow_offset_y;
|
w->shadow_dy = shadow_offset_y;
|
||||||
|
|
||||||
if (!w->shadow) {
|
if (!w->shadow) {
|
||||||
double opacity = shadow_opacity;
|
double opacity = shadow_opacity;
|
||||||
|
|
||||||
if (w->mode == WINDOW_TRANS) {
|
if (w->mode == WINDOW_TRANS) {
|
||||||
opacity = opacity * ((double)w->opacity) / ((double)OPAQUE);
|
opacity = opacity * ((double)w->opacity) / ((double)OPAQUE);
|
||||||
}
|
|
||||||
|
|
||||||
w->shadow = shadow_picture(
|
|
||||||
dpy, opacity, w->alpha_pict,
|
|
||||||
w->a.width + w->a.border_width * 2,
|
|
||||||
w->a.height + w->a.border_width * 2,
|
|
||||||
&w->shadow_width, &w->shadow_height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sr.x = w->a.x + w->shadow_dx;
|
w->shadow = shadow_picture(
|
||||||
sr.y = w->a.y + w->shadow_dy;
|
dpy, opacity, w->alpha_pict,
|
||||||
sr.width = w->shadow_width;
|
w->a.width + w->a.border_width * 2,
|
||||||
sr.height = w->shadow_height;
|
w->a.height + w->a.border_width * 2,
|
||||||
if (sr.x < r.x) {
|
&w->shadow_width, &w->shadow_height);
|
||||||
r.width = (r.x + r.width) - sr.x;
|
}
|
||||||
r.x = sr.x;
|
|
||||||
}
|
sr.x = w->a.x + w->shadow_dx;
|
||||||
if (sr.y < r.y) {
|
sr.y = w->a.y + w->shadow_dy;
|
||||||
r.height = (r.y + r.height) - sr.y;
|
sr.width = w->shadow_width;
|
||||||
r.y = sr.y;
|
sr.height = w->shadow_height;
|
||||||
}
|
|
||||||
if (sr.x + sr.width > r.x + r.width) {
|
if (sr.x < r.x) {
|
||||||
r.width = sr.x + sr.width - r.x;
|
r.width = (r.x + r.width) - sr.x;
|
||||||
}
|
r.x = sr.x;
|
||||||
if (sr.y + sr.height > r.y + r.height) {
|
}
|
||||||
r.height = sr.y + sr.height - r.y;
|
|
||||||
}
|
if (sr.y < r.y) {
|
||||||
|
r.height = (r.y + r.height) - sr.y;
|
||||||
|
r.y = sr.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sr.x + sr.width > r.x + r.width) {
|
||||||
|
r.width = sr.x + sr.width - r.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sr.y + sr.height > r.y + r.height) {
|
||||||
|
r.height = sr.y + sr.height - r.y;
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -889,8 +913,10 @@ border_size(Display *dpy, win *w) {
|
|||||||
* of creates, that way you'd just end up with an empty region
|
* of creates, that way you'd just end up with an empty region
|
||||||
* instead of an invalid XID.
|
* instead of an invalid XID.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
set_ignore(dpy, NextRequest(dpy));
|
set_ignore(dpy, NextRequest(dpy));
|
||||||
border = XFixesCreateRegionFromWindow(dpy, w->id, WindowRegionBounding);
|
border = XFixesCreateRegionFromWindow(
|
||||||
|
dpy, w->id, WindowRegionBounding);
|
||||||
|
|
||||||
/* translate this */
|
/* translate this */
|
||||||
set_ignore(dpy, NextRequest(dpy));
|
set_ignore(dpy, NextRequest(dpy));
|
||||||
@ -1008,6 +1034,7 @@ paint_all(Display *dpy, XserverRegion region) {
|
|||||||
|
|
||||||
if (w->mode == WINDOW_SOLID) {
|
if (w->mode == WINDOW_SOLID) {
|
||||||
int x, y, wid, hei;
|
int x, y, wid, hei;
|
||||||
|
|
||||||
#if HAS_NAME_WINDOW_PIXMAP
|
#if HAS_NAME_WINDOW_PIXMAP
|
||||||
x = w->a.x;
|
x = w->a.x;
|
||||||
y = w->a.y;
|
y = w->a.y;
|
||||||
@ -1019,10 +1046,13 @@ paint_all(Display *dpy, XserverRegion region) {
|
|||||||
wid = w->a.width;
|
wid = w->a.width;
|
||||||
hei = w->a.height;
|
hei = w->a.height;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XFixesSetPictureClipRegion(dpy, root_buffer, 0, 0, region);
|
XFixesSetPictureClipRegion(dpy, root_buffer, 0, 0, region);
|
||||||
set_ignore(dpy, NextRequest(dpy));
|
set_ignore(dpy, NextRequest(dpy));
|
||||||
|
|
||||||
XFixesSubtractRegion(dpy, region, region, w->border_size);
|
XFixesSubtractRegion(dpy, region, region, w->border_size);
|
||||||
set_ignore(dpy, NextRequest(dpy));
|
set_ignore(dpy, NextRequest(dpy));
|
||||||
|
|
||||||
XRenderComposite(
|
XRenderComposite(
|
||||||
dpy, PictOpSrc, w->picture,
|
dpy, PictOpSrc, w->picture,
|
||||||
None, root_buffer, 0, 0, 0, 0,
|
None, root_buffer, 0, 0, 0, 0,
|
||||||
@ -1043,11 +1073,13 @@ paint_all(Display *dpy, XserverRegion region) {
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XFixesSetPictureClipRegion(dpy, root_buffer, 0, 0, region);
|
XFixesSetPictureClipRegion(dpy,
|
||||||
|
root_buffer, 0, 0, region);
|
||||||
paint_root(dpy);
|
paint_root(dpy);
|
||||||
|
|
||||||
for (w = t; w; w = w->prev_trans) {
|
for (w = t; w; w = w->prev_trans) {
|
||||||
XFixesSetPictureClipRegion(dpy, root_buffer, 0, 0, w->border_clip);
|
XFixesSetPictureClipRegion(dpy,
|
||||||
|
root_buffer, 0, 0, w->border_clip);
|
||||||
|
|
||||||
if (win_type_shadow[w->window_type]) {
|
if (win_type_shadow[w->window_type]) {
|
||||||
XRenderComposite(
|
XRenderComposite(
|
||||||
@ -1059,11 +1091,12 @@ paint_all(Display *dpy, XserverRegion region) {
|
|||||||
|
|
||||||
if (w->opacity != OPAQUE && !w->alpha_pict) {
|
if (w->opacity != OPAQUE && !w->alpha_pict) {
|
||||||
w->alpha_pict = solid_picture(
|
w->alpha_pict = solid_picture(
|
||||||
dpy, False, (double) w->opacity / OPAQUE, 0, 0, 0);
|
dpy, False, (double)w->opacity / OPAQUE, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->mode == WINDOW_TRANS) {
|
if (w->mode == WINDOW_TRANS) {
|
||||||
int x, y, wid, hei;
|
int x, y, wid, hei;
|
||||||
|
|
||||||
#if HAS_NAME_WINDOW_PIXMAP
|
#if HAS_NAME_WINDOW_PIXMAP
|
||||||
x = w->a.x;
|
x = w->a.x;
|
||||||
y = w->a.y;
|
y = w->a.y;
|
||||||
@ -1075,12 +1108,15 @@ paint_all(Display *dpy, XserverRegion region) {
|
|||||||
wid = w->a.width;
|
wid = w->a.width;
|
||||||
hei = w->a.height;
|
hei = w->a.height;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_ignore(dpy, NextRequest(dpy));
|
set_ignore(dpy, NextRequest(dpy));
|
||||||
|
|
||||||
XRenderComposite(
|
XRenderComposite(
|
||||||
dpy, PictOpOver, w->picture, w->alpha_pict,
|
dpy, PictOpOver, w->picture, w->alpha_pict,
|
||||||
root_buffer, 0, 0, 0, 0, x, y, wid, hei);
|
root_buffer, 0, 0, 0, 0, x, y, wid, hei);
|
||||||
} else if (w->mode == WINDOW_ARGB) {
|
} else if (w->mode == WINDOW_ARGB) {
|
||||||
int x, y, wid, hei;
|
int x, y, wid, hei;
|
||||||
|
|
||||||
#if HAS_NAME_WINDOW_PIXMAP
|
#if HAS_NAME_WINDOW_PIXMAP
|
||||||
x = w->a.x;
|
x = w->a.x;
|
||||||
y = w->a.y;
|
y = w->a.y;
|
||||||
@ -1092,11 +1128,15 @@ paint_all(Display *dpy, XserverRegion region) {
|
|||||||
wid = w->a.width;
|
wid = w->a.width;
|
||||||
hei = w->a.height;
|
hei = w->a.height;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_ignore(dpy, NextRequest(dpy));
|
set_ignore(dpy, NextRequest(dpy));
|
||||||
XRenderComposite(dpy, PictOpOver, w->picture, w->alpha_pict, root_buffer,
|
|
||||||
0, 0, 0, 0,
|
XRenderComposite(
|
||||||
x, y, wid, hei);
|
dpy, PictOpOver, w->picture, w->alpha_pict,
|
||||||
|
root_buffer, 0, 0, 0, 0,
|
||||||
|
x, y, wid, hei);
|
||||||
}
|
}
|
||||||
|
|
||||||
XFixesDestroyRegion(dpy, w->border_clip);
|
XFixesDestroyRegion(dpy, w->border_clip);
|
||||||
w->border_clip = None;
|
w->border_clip = None;
|
||||||
}
|
}
|
||||||
@ -1105,8 +1145,10 @@ paint_all(Display *dpy, XserverRegion region) {
|
|||||||
|
|
||||||
if (root_buffer != root_picture) {
|
if (root_buffer != root_picture) {
|
||||||
XFixesSetPictureClipRegion(dpy, root_buffer, 0, 0, None);
|
XFixesSetPictureClipRegion(dpy, root_buffer, 0, 0, None);
|
||||||
XRenderComposite(dpy, PictOpSrc, root_buffer, None, root_picture,
|
XRenderComposite(
|
||||||
0, 0, 0, 0, 0, 0, root_width, root_height);
|
dpy, PictOpSrc, root_buffer, None,
|
||||||
|
root_picture, 0, 0, 0, 0,
|
||||||
|
0, 0, root_width, root_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1145,23 +1187,55 @@ repair_win(Display *dpy, win *w) {
|
|||||||
static const char*
|
static const char*
|
||||||
wintype_name(wintype type) {
|
wintype_name(wintype type) {
|
||||||
const char *t;
|
const char *t;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WINTYPE_DESKTOP: t = "desktop"; break;
|
case WINTYPE_DESKTOP:
|
||||||
case WINTYPE_DOCK: t = "dock"; break;
|
t = "desktop";
|
||||||
case WINTYPE_TOOLBAR: t = "toolbar"; break;
|
break;
|
||||||
case WINTYPE_MENU: t = "menu"; break;
|
case WINTYPE_DOCK:
|
||||||
case WINTYPE_UTILITY: t = "utility"; break;
|
t = "dock";
|
||||||
case WINTYPE_SPLASH: t = "slash"; break;
|
break;
|
||||||
case WINTYPE_DIALOG: t = "dialog"; break;
|
case WINTYPE_TOOLBAR:
|
||||||
case WINTYPE_NORMAL: t = "normal"; break;
|
t = "toolbar";
|
||||||
case WINTYPE_DROPDOWN_MENU: t = "dropdown"; break;
|
break;
|
||||||
case WINTYPE_POPUP_MENU: t = "popup"; break;
|
case WINTYPE_MENU:
|
||||||
case WINTYPE_TOOLTIP: t = "tooltip"; break;
|
t = "menu";
|
||||||
case WINTYPE_NOTIFY: t = "notification"; break;
|
break;
|
||||||
case WINTYPE_COMBO: t = "combo"; break;
|
case WINTYPE_UTILITY:
|
||||||
case WINTYPE_DND: t = "dnd"; break;
|
t = "utility";
|
||||||
default: t = "unknown"; break;
|
break;
|
||||||
|
case WINTYPE_SPLASH:
|
||||||
|
t = "slash";
|
||||||
|
break;
|
||||||
|
case WINTYPE_DIALOG:
|
||||||
|
t = "dialog";
|
||||||
|
break;
|
||||||
|
case WINTYPE_NORMAL:
|
||||||
|
t = "normal";
|
||||||
|
break;
|
||||||
|
case WINTYPE_DROPDOWN_MENU:
|
||||||
|
t = "dropdown";
|
||||||
|
break;
|
||||||
|
case WINTYPE_POPUP_MENU:
|
||||||
|
t = "popup";
|
||||||
|
break;
|
||||||
|
case WINTYPE_TOOLTIP:
|
||||||
|
t = "tooltip";
|
||||||
|
break;
|
||||||
|
case WINTYPE_NOTIFY:
|
||||||
|
t = "notification";
|
||||||
|
break;
|
||||||
|
case WINTYPE_COMBO:
|
||||||
|
t = "combo";
|
||||||
|
break;
|
||||||
|
case WINTYPE_DND:
|
||||||
|
t = "dnd";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
t = "unknown";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1178,11 +1252,13 @@ get_wintype_prop(Display * dpy, Window w) {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
set_ignore(dpy, NextRequest(dpy));
|
set_ignore(dpy, NextRequest(dpy));
|
||||||
|
|
||||||
int result = XGetWindowProperty(
|
int result = XGetWindowProperty(
|
||||||
dpy, w, win_type_atom, off, 1L, False, XA_ATOM,
|
dpy, w, win_type_atom, off, 1L, False, XA_ATOM,
|
||||||
&actual, &format, &n, &left, &data);
|
&actual, &format, &n, &left, &data);
|
||||||
|
|
||||||
if (result != Success) break;
|
if (result != Success) break;
|
||||||
|
|
||||||
if (data != None) {
|
if (data != None) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1246,19 +1322,22 @@ static void
|
|||||||
configure_win(Display *dpy, XConfigureEvent *ce);
|
configure_win(Display *dpy, XConfigureEvent *ce);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
map_win(Display *dpy, Window id, unsigned long sequence, Bool fade) {
|
map_win(Display *dpy, Window id,
|
||||||
|
unsigned long sequence, Bool fade) {
|
||||||
win *w = find_win(dpy, id);
|
win *w = find_win(dpy, id);
|
||||||
|
|
||||||
if (!w) return;
|
if (!w) return;
|
||||||
|
|
||||||
w->a.map_state = IsViewable;
|
w->a.map_state = IsViewable;
|
||||||
|
|
||||||
w->window_type = determine_wintype(dpy, w->id, w->id);
|
w->window_type = determine_wintype(dpy, w->id, w->id);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printf("window 0x%x type %s\n", w->id, wintype_name(w->window_type));
|
printf("window 0x%x type %s\n",
|
||||||
|
w->id, wintype_name(w->window_type));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* select before reading the property so that no property changes are lost */
|
/* select before reading the property
|
||||||
|
so that no property changes are lost */
|
||||||
XSelectInput(dpy, id, PropertyChangeMask);
|
XSelectInput(dpy, id, PropertyChangeMask);
|
||||||
w->opacity = get_opacity_prop(dpy, w, OPAQUE);
|
w->opacity = get_opacity_prop(dpy, w, OPAQUE);
|
||||||
|
|
||||||
@ -1276,8 +1355,9 @@ map_win(Display *dpy, Window id, unsigned long sequence, Bool fade) {
|
|||||||
fade_in_step, 0, True, True);
|
fade_in_step, 0, True, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if any configure events happened while the window was unmapped, then
|
/* if any configure events happened while
|
||||||
configure the window to its correct place */
|
the window was unmapped, then configure
|
||||||
|
the window to its correct place */
|
||||||
if (w->need_configure) {
|
if (w->need_configure) {
|
||||||
configure_win(dpy, &w->queue_configure);
|
configure_win(dpy, &w->queue_configure);
|
||||||
}
|
}
|
||||||
@ -1348,7 +1428,7 @@ unmap_win(Display *dpy, Window id, Bool fade) {
|
|||||||
|
|
||||||
#if HAS_NAME_WINDOW_PIXMAP
|
#if HAS_NAME_WINDOW_PIXMAP
|
||||||
if (w->pixmap && fade && win_type_fade[w->window_type]) {
|
if (w->pixmap && fade && win_type_fade[w->window_type]) {
|
||||||
set_fade(dpy, w, w->opacity*1.0/OPAQUE, 0.0,
|
set_fade(dpy, w, w->opacity * 1.0 / OPAQUE, 0.0,
|
||||||
fade_out_step, unmap_callback, False, True);
|
fade_out_step, unmap_callback, False, True);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@ -1373,21 +1453,24 @@ get_opacity_prop(Display *dpy, win *w, unsigned int def) {
|
|||||||
if (result == Success && data != NULL) {
|
if (result == Success && data != NULL) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
memcpy(&i, data, sizeof(unsigned int));
|
memcpy(&i, data, sizeof(unsigned int));
|
||||||
XFree((void *) data);
|
XFree((void *)data);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the opacity property from the window in a percent format
|
/*
|
||||||
not found: default
|
* Get the opacity property from the window in a percent format
|
||||||
otherwise: the value
|
* not found: default
|
||||||
|
* otherwise: the value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static double
|
static double
|
||||||
get_opacity_percent(Display *dpy, win *w) {
|
get_opacity_percent(Display *dpy, win *w) {
|
||||||
double def = win_type_opacity[w->window_type];
|
double def = win_type_opacity[w->window_type];
|
||||||
unsigned int opacity = get_opacity_prop(dpy, w, (unsigned int)(OPAQUE * def));
|
unsigned int opacity =
|
||||||
|
get_opacity_prop(dpy, w, (unsigned int)(OPAQUE * def));
|
||||||
|
|
||||||
return opacity * 1.0 / OPAQUE;
|
return opacity * 1.0 / OPAQUE;
|
||||||
}
|
}
|
||||||
@ -1415,7 +1498,8 @@ determine_mode(Display *dpy, win *w) {
|
|||||||
format = XRenderFindVisualFormat(dpy, w->a.visual);
|
format = XRenderFindVisualFormat(dpy, w->a.visual);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (format && format->type == PictTypeDirect && format->direct.alphaMask) {
|
if (format && format->type == PictTypeDirect
|
||||||
|
&& format->direct.alphaMask) {
|
||||||
mode = WINDOW_ARGB;
|
mode = WINDOW_ARGB;
|
||||||
} else if (w->opacity != OPAQUE) {
|
} else if (w->opacity != OPAQUE) {
|
||||||
mode = WINDOW_TRANS;
|
mode = WINDOW_TRANS;
|
||||||
@ -1575,6 +1659,7 @@ configure_win(Display *dpy, XConfigureEvent *ce) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (w->shadow) {
|
if (w->shadow) {
|
||||||
XRenderFreePicture(dpy, w->shadow);
|
XRenderFreePicture(dpy, w->shadow);
|
||||||
w->shadow = None;
|
w->shadow = None;
|
||||||
@ -1586,7 +1671,7 @@ configure_win(Display *dpy, XConfigureEvent *ce) {
|
|||||||
w->a.border_width = ce->border_width;
|
w->a.border_width = ce->border_width;
|
||||||
|
|
||||||
if (w->a.map_state != IsUnmapped && damage) {
|
if (w->a.map_state != IsUnmapped && damage) {
|
||||||
XserverRegion extents = win_extents(dpy, w);
|
XserverRegion extents = win_extents(dpy, w);
|
||||||
XFixesUnionRegion(dpy, damage, damage, extents);
|
XFixesUnionRegion(dpy, damage, damage, extents);
|
||||||
XFixesDestroyRegion(dpy, extents);
|
XFixesDestroyRegion(dpy, extents);
|
||||||
add_damage(dpy, damage);
|
add_damage(dpy, damage);
|
||||||
@ -1668,8 +1753,9 @@ destroy_win(Display *dpy, Window id, Bool fade) {
|
|||||||
|
|
||||||
#if HAS_NAME_WINDOW_PIXMAP
|
#if HAS_NAME_WINDOW_PIXMAP
|
||||||
if (w && w->pixmap && fade && win_type_fade[w->window_type]) {
|
if (w && w->pixmap && fade && win_type_fade[w->window_type]) {
|
||||||
set_fade(dpy, w, w->opacity*1.0/OPAQUE, 0.0, fade_out_step,
|
set_fade(dpy, w, w->opacity * 1.0 / OPAQUE,
|
||||||
destroy_callback, False, True);
|
0.0, fade_out_step, destroy_callback,
|
||||||
|
False, True);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -1681,7 +1767,8 @@ destroy_win(Display *dpy, Window id, Bool fade) {
|
|||||||
static void
|
static void
|
||||||
dump_win(win *w) {
|
dump_win(win *w) {
|
||||||
printf("\t%08lx: %d x %d + %d + %d(%d)\n", w->id,
|
printf("\t%08lx: %d x %d + %d + %d(%d)\n", w->id,
|
||||||
w->a.width, w->a.height, w->a.x, w->a.y, w->a.border_width);
|
w->a.width, w->a.height,
|
||||||
|
w->a.x, w->a.y, w->a.border_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1690,8 +1777,9 @@ dump_wins(void) {
|
|||||||
win *w;
|
win *w;
|
||||||
|
|
||||||
printf("windows:\n");
|
printf("windows:\n");
|
||||||
for (w = list; w; w = w->next)
|
for (w = list; w; w = w->next) {
|
||||||
dump_win(w);
|
dump_win(w);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1714,24 +1802,28 @@ damage_win(Display *dpy, XDamageNotifyEvent *de) {
|
|||||||
w->damage_bounds.height += (w->damage_bounds.y - de->area.y);
|
w->damage_bounds.height += (w->damage_bounds.y - de->area.y);
|
||||||
w->damage_bounds.y = de->area.y;
|
w->damage_bounds.y = de->area.y;
|
||||||
}
|
}
|
||||||
if (de->area.x + de->area.width > w->damage_bounds.x + w->damage_bounds.width) {
|
if (de->area.x + de->area.width
|
||||||
w->damage_bounds.width = de->area.x + de->area.width - w->damage_bounds.x;
|
> w->damage_bounds.x + w->damage_bounds.width) {
|
||||||
|
w->damage_bounds.width =
|
||||||
|
de->area.x + de->area.width - w->damage_bounds.x;
|
||||||
}
|
}
|
||||||
if (de->area.y + de->area.height > w->damage_bounds.y + w->damage_bounds.height) {
|
if (de->area.y + de->area.height
|
||||||
w->damage_bounds.height = de->area.y + de->area.height - w->damage_bounds.y;
|
> w->damage_bounds.y + w->damage_bounds.height) {
|
||||||
|
w->damage_bounds.height =
|
||||||
|
de->area.y + de->area.height - w->damage_bounds.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printf("unusable damage %d, %d: %d x %d bounds %d, %d: %d x %d\n",
|
printf("unusable damage %d, %d: %d x %d bounds %d, %d: %d x %d\n",
|
||||||
de->area.x,
|
de->area.x,
|
||||||
de->area.y,
|
de->area.y,
|
||||||
de->area.width,
|
de->area.width,
|
||||||
de->area.height,
|
de->area.height,
|
||||||
w->damage_bounds.x,
|
w->damage_bounds.x,
|
||||||
w->damage_bounds.y,
|
w->damage_bounds.y,
|
||||||
w->damage_bounds.width,
|
w->damage_bounds.width,
|
||||||
w->damage_bounds.height);
|
w->damage_bounds.height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (w->damage_bounds.x <= 0 &&
|
if (w->damage_bounds.x <= 0 &&
|
||||||
@ -1761,36 +1853,53 @@ error(Display *dpy, XErrorEvent *ev) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->request_code == composite_opcode &&
|
if (ev->request_code == composite_opcode
|
||||||
ev->minor_code == X_CompositeRedirectSubwindows) {
|
&& ev->minor_code == X_CompositeRedirectSubwindows) {
|
||||||
fprintf(stderr, "Another composite manager is already running\n");
|
fprintf(stderr, "Another composite manager is already running\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
o = ev->error_code - xfixes_error;
|
o = ev->error_code - xfixes_error;
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case BadRegion: name = "BadRegion"; break;
|
case BadRegion:
|
||||||
default: break;
|
name = "BadRegion";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
o = ev->error_code - damage_error;
|
o = ev->error_code - damage_error;
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case BadDamage: name = "BadDamage"; break;
|
case BadDamage:
|
||||||
default: break;
|
name = "BadDamage";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
o = ev->error_code - render_error;
|
o = ev->error_code - render_error;
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case BadPictFormat: name ="BadPictFormat"; break;
|
case BadPictFormat:
|
||||||
case BadPicture: name ="BadPicture"; break;
|
name ="BadPictFormat";
|
||||||
case BadPictOp: name ="BadPictOp"; break;
|
break;
|
||||||
case BadGlyphSet: name ="BadGlyphSet"; break;
|
case BadPicture:
|
||||||
case BadGlyph: name ="BadGlyph"; break;
|
name ="BadPicture";
|
||||||
|
break;
|
||||||
|
case BadPictOp:
|
||||||
|
name ="BadPictOp";
|
||||||
|
break;
|
||||||
|
case BadGlyphSet:
|
||||||
|
name ="BadGlyphSet";
|
||||||
|
break;
|
||||||
|
case BadGlyph:
|
||||||
|
name ="BadGlyph";
|
||||||
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("error %d request %d minor %d serial %lu\n",
|
printf("error %d request %d minor %d serial %lu\n",
|
||||||
ev->error_code, ev->request_code, ev->minor_code, ev->serial);
|
ev->error_code, ev->request_code,
|
||||||
|
ev->minor_code, ev->serial);
|
||||||
|
|
||||||
/* abort(); this is just annoying to most people */
|
/* abort(); this is just annoying to most people */
|
||||||
return 0;
|
return 0;
|
||||||
@ -1814,7 +1923,7 @@ ev_serial(XEvent *ev) {
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
ev_name(XEvent *ev) {
|
ev_name(XEvent *ev) {
|
||||||
static char buf[128];
|
static char buf[128];
|
||||||
switch (ev->type & 0x7f) {
|
switch (ev->type & 0x7f) {
|
||||||
case Expose:
|
case Expose:
|
||||||
return "Expose";
|
return "Expose";
|
||||||
@ -1850,7 +1959,7 @@ ev_window(XEvent *ev) {
|
|||||||
return ev->xcirculate.window;
|
return ev->xcirculate.window;
|
||||||
default:
|
default:
|
||||||
if (ev->type == damage_event + XDamageNotify) {
|
if (ev->type == damage_event + XDamageNotify) {
|
||||||
return ((XDamageNotifyEvent *) ev)->drawable;
|
return ((XDamageNotifyEvent *)ev)->drawable;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1864,31 +1973,44 @@ usage(char *program) {
|
|||||||
|
|
||||||
fprintf(stderr, "Options\n");
|
fprintf(stderr, "Options\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -d display\n which display should be managed.\n");
|
" -d display\n "
|
||||||
|
"Which display should be managed.\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -r radius\n the blur radius for shadows. (default 12)\n");
|
" -r radius\n "
|
||||||
|
"The blur radius for shadows. (default 12)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -o opacity\n the translucency for shadows. (default .75)\n");
|
" -o opacity\n "
|
||||||
|
"The translucency for shadows. (default .75)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -l left-offset\n the left offset for shadows. (default -15)\n");
|
" -l left-offset\n "
|
||||||
|
"The left offset for shadows. (default -15)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -t top-offset\n the top offset for shadows. (default -15)\n");
|
" -t top-offset\n "
|
||||||
|
"The top offset for shadows. (default -15)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -I fade-in-step\n opacity change between steps while fading in. (default 0.028)\n");
|
" -I fade-in-step\n "
|
||||||
|
"Opacity change between steps while fading in. (default 0.028)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -O fade-out-step\n opacity change between steps while fading out. (default 0.03)\n");
|
" -O fade-out-step\n "
|
||||||
|
"Opacity change between steps while fading out. (default 0.03)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -D fade-delta-time\n the time between steps in a fade in milliseconds. (default 10)\n");
|
" -D fade-delta-time\n "
|
||||||
|
"The time between steps in a fade in milliseconds. (default 10)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -m opacity\n the opacity for menus. (default 1.0)\n");
|
" -m opacity\n "
|
||||||
|
"The opacity for menus. (default 1.0)\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -C\n Avoid drawing shadows on dock/panel windows.\n");
|
" -C\n "
|
||||||
|
"Avoid drawing shadows on dock/panel windows.\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -f\n Fade windows in/out when opening/closing.\n");
|
" -f\n "
|
||||||
|
"Fade windows in/out when opening/closing.\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -F\n Fade windows during opacity changes.\n");
|
" -F\n "
|
||||||
|
"Fade windows during opacity changes.\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" -S\n Enable synchronous operation (for debugging).\n");
|
" -S\n "
|
||||||
|
"Enable synchronous operation (for debugging).\n");
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -2043,7 +2165,7 @@ main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!XQueryExtension(dpy, COMPOSITE_NAME, &composite_opcode,
|
if (!XQueryExtension(dpy, COMPOSITE_NAME, &composite_opcode,
|
||||||
&composite_event, &composite_error)) {
|
&composite_event, &composite_error)) {
|
||||||
fprintf(stderr, "No composite extension\n");
|
fprintf(stderr, "No composite extension\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -2119,12 +2241,15 @@ main(int argc, char **argv) {
|
|||||||
clip_changed = True;
|
clip_changed = True;
|
||||||
XGrabServer(dpy);
|
XGrabServer(dpy);
|
||||||
|
|
||||||
XCompositeRedirectSubwindows(dpy, root, CompositeRedirectManual);
|
XCompositeRedirectSubwindows(
|
||||||
|
dpy, root, CompositeRedirectManual);
|
||||||
|
|
||||||
XSelectInput(dpy, root,
|
XSelectInput(dpy, root,
|
||||||
SubstructureNotifyMask
|
SubstructureNotifyMask
|
||||||
| ExposureMask
|
| ExposureMask
|
||||||
| StructureNotifyMask
|
| StructureNotifyMask
|
||||||
| PropertyChangeMask);
|
| PropertyChangeMask);
|
||||||
|
|
||||||
XQueryTree(dpy, root, &root_return,
|
XQueryTree(dpy, root, &root_return,
|
||||||
&parent_return, &children, &nchildren);
|
&parent_return, &children, &nchildren);
|
||||||
|
|
||||||
@ -2194,8 +2319,7 @@ main(int argc, char **argv) {
|
|||||||
if (n_expose == size_expose) {
|
if (n_expose == size_expose) {
|
||||||
if (expose_rects) {
|
if (expose_rects) {
|
||||||
expose_rects = realloc(expose_rects,
|
expose_rects = realloc(expose_rects,
|
||||||
(size_expose + more) *
|
(size_expose + more) * sizeof(XRectangle));
|
||||||
sizeof(XRectangle));
|
|
||||||
size_expose += more;
|
size_expose += more;
|
||||||
} else {
|
} else {
|
||||||
expose_rects = malloc(more * sizeof(XRectangle));
|
expose_rects = malloc(more * sizeof(XRectangle));
|
||||||
@ -2215,7 +2339,8 @@ main(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
case PropertyNotify:
|
case PropertyNotify:
|
||||||
for (p = 0; background_props[p]; p++) {
|
for (p = 0; background_props[p]; p++) {
|
||||||
if (ev.xproperty.atom == XInternAtom(dpy, background_props[p], False)) {
|
if (ev.xproperty.atom ==
|
||||||
|
XInternAtom(dpy, background_props[p], False)) {
|
||||||
if (root_tile) {
|
if (root_tile) {
|
||||||
XClearArea(dpy, root, 0, 0, 0, 0, True);
|
XClearArea(dpy, root, 0, 0, 0, 0, True);
|
||||||
XRenderFreePicture(dpy, root_tile);
|
XRenderFreePicture(dpy, root_tile);
|
||||||
@ -2253,7 +2378,7 @@ main(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (ev.type == damage_event + XDamageNotify) {
|
if (ev.type == damage_event + XDamageNotify) {
|
||||||
damage_win(dpy, (XDamageNotifyEvent *) &ev);
|
damage_win(dpy, (XDamageNotifyEvent *)&ev);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user