summaryrefslogtreecommitdiff
path: root/src/Xrandr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xrandr.c')
-rw-r--r--src/Xrandr.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/Xrandr.c b/src/Xrandr.c
index e3f9931..2de995c 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -86,18 +86,16 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
return True;
}
case RRNotify: {
- XRRNotifyEvent *aevent = (XRRNotifyEvent *) event;
- xRRCrtcChangeNotifyEvent *awire = (xRRCrtcChangeNotifyEvent *) wire;
- aevent->type = awire->type & 0x7F;
- aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
- aevent->send_event = (awire->type & 0x80) != 0;
- aevent->display = dpy;
- aevent->subtype = awire->subCode;
- switch (aevent->subtype) {
+ switch (wire->u.u.detail) {
case RRNotify_OutputChange: {
XRROutputChangeNotifyEvent *aevent = (XRROutputChangeNotifyEvent *) event;
xRROutputChangeNotifyEvent *awire = (xRROutputChangeNotifyEvent *) wire;
+ aevent->type = awire->type & 0x7F;
+ aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
+ aevent->send_event = (awire->type & 0x80) != 0;
+ aevent->display = dpy;
aevent->window = awire->window;
+ aevent->subtype = awire->subCode;
aevent->output = awire->output;
aevent->crtc = awire->crtc;
aevent->mode = awire->mode;
@@ -109,7 +107,12 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
case RRNotify_CrtcChange: {
XRRCrtcChangeNotifyEvent *aevent = (XRRCrtcChangeNotifyEvent *) event;
xRRCrtcChangeNotifyEvent *awire = (xRRCrtcChangeNotifyEvent *) wire;
+ aevent->type = awire->type & 0x7F;
+ aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
+ aevent->send_event = (awire->type & 0x80) != 0;
+ aevent->display = dpy;
aevent->window = awire->window;
+ aevent->subtype = awire->subCode;
aevent->crtc = awire->crtc;
aevent->mode = awire->mode;
aevent->rotation = awire->rotation;
@@ -122,7 +125,12 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
case RRNotify_OutputProperty: {
XRROutputPropertyNotifyEvent *aevent = (XRROutputPropertyNotifyEvent *) event;
xRROutputPropertyNotifyEvent *awire = (xRROutputPropertyNotifyEvent *) wire;
+ aevent->type = awire->type & 0x7F;
+ aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
+ aevent->send_event = (awire->type & 0x80) != 0;
+ aevent->display = dpy;
aevent->window = awire->window;
+ aevent->subtype = awire->subCode;
aevent->output = awire->output;
aevent->property = awire->atom;
aevent->timestamp = awire->timestamp;