blob: a7f063a122d0b03c6912be9b0fc197ca9dc0a692 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
$NetBSD: patch-aa,v 1.1 2008/01/29 03:50:26 bjs Exp $
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. (from GIT)
--- src/Xdamage.c.orig 2007-01-09 19:20:57.000000000 -0500
+++ src/Xdamage.c
@@ -231,7 +231,8 @@ XDamageWireToEvent(Display *dpy, XEvent
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
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;
|