summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2007-09-07 22:02:18 -0700
committerKeith Packard <keithp@koto.keithp.com>2007-09-07 22:02:18 -0700
commitd9714f03dde2d2b20fb29d46b44bb253e4954ee0 (patch)
tree9b538a7dd3d31d70ef1e9233252d660b86484df1 /src
parent7548981a458b091b29d74207884669214f63ee9f (diff)
libXdamage incorrectly encodes/decodes the 'More' field from the event.
The client library for xdamage currently fails to fill in the 'more' field. As a result, you get whatever uninitialised junk was there before. The server sets the high bit of 'level' when there is 'more' (DamageNotifyMore = 0x80). A patch follows to fix the client library.
Diffstat (limited to 'src')
-rw-r--r--src/Xdamage.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Xdamage.c b/src/Xdamage.c
index 213834c..c699a15 100644
--- a/src/Xdamage.c
+++ b/src/Xdamage.c
@@ -231,7 +231,8 @@ XDamageWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
aevent->display = dpy;
aevent->drawable = awire->drawable;
aevent->damage = awire->damage;
- aevent->level = awire->level;
+ aevent->level = awire->level & ~DamageNotifyMore;
+ aevent->more = (awire->level & DamageNotifyMore) ? True : False;
aevent->timestamp = awire->timestamp;
aevent->area.x = awire->area.x;
aevent->area.y = awire->area.y;
@@ -264,7 +265,7 @@ XDamageEventToWire(Display *dpy, XEvent *event, xEvent *wire)
awire->type = aevent->type | (aevent->send_event ? 0x80 : 0);
awire->drawable = aevent->drawable;
awire->damage = aevent->damage;
- awire->level = aevent->level;
+ awire->level = aevent->level | (aevent->more ? DamageNotifyMore : 0);
awire->timestamp = aevent->timestamp;
awire->area.x = aevent->area.x;
awire->area.y = aevent->area.y;