From 1dfa6aa7474d12b23cc21f5f3e3a60fcc89c660c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 29 Jun 2012 14:09:16 +0100 Subject: update with latest changes to protocol --- include/X11/extensions/Xrandr.h | 12 ++++++++++++ src/Xrandr.c | 20 ++++++++++++++++++++ src/XrrProvider.c | 1 + 3 files changed, 33 insertions(+) diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h index d293a4b..27aa496 100644 --- a/include/X11/extensions/Xrandr.h +++ b/include/X11/extensions/Xrandr.h @@ -128,6 +128,7 @@ typedef struct { Window window; /* window which selected for this event */ int subtype; /* RRNotify_ProviderChange */ RRProvider provider; /* current provider (or None) */ + Time timestamp; /* time of change */ unsigned int current_role; } XRRProviderChangeNotifyEvent; @@ -144,6 +145,16 @@ typedef struct { int state; /* NewValue, Deleted */ } XRRProviderPropertyNotifyEvent; +typedef struct { + int type; /* event base */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* window which selected for this event */ + int subtype; /* RRNotify_ResourceChange */ + Time timestamp; /* time of change */ +} XRRResourceChangeNotifyEvent; + /* internal representation is private to the library */ typedef struct _XRRScreenConfiguration XRRScreenConfiguration; @@ -482,6 +493,7 @@ typedef struct _XRRProviderResources { int nproviders; RRProvider *providers; unsigned int flags; + unsigned int max_master; } XRRProviderResources; XRRProviderResources * diff --git a/src/Xrandr.c b/src/Xrandr.c index b7ddfba..a16a06e 100644 --- a/src/Xrandr.c +++ b/src/Xrandr.c @@ -148,6 +148,7 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire) aevent->subtype = awire->subCode; aevent->provider = awire->provider; aevent->current_role = awire->current_role; + aevent->timestamp = awire->timestamp; return True; } case RRNotify_ProviderProperty: { @@ -164,6 +165,18 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire) aevent->timestamp = awire->timestamp; aevent->state = awire->state; return True; + } + case RRNotify_ResourceChange: { + XRRResourceChangeNotifyEvent *aevent = (XRRResourceChangeNotifyEvent *) event; + xRRResourceChangeNotifyEvent *awire = (xRRResourceChangeNotifyEvent *) 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->timestamp = awire->timestamp; + return True; } break; } @@ -259,6 +272,13 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire) awire->state = aevent->state; return True; } + case RRNotify_ResourceChange: { + xRRResourceChangeNotifyEvent *awire = (xRRResourceChangeNotifyEvent *) wire; + XRRResourceChangeNotifyEvent *aevent = (XRRResourceChangeNotifyEvent *) event; + awire->window = aevent->window; + awire->timestamp = aevent->timestamp; + return True; + } } } } diff --git a/src/XrrProvider.c b/src/XrrProvider.c index b6c3593..e0f152b 100644 --- a/src/XrrProvider.c +++ b/src/XrrProvider.c @@ -73,6 +73,7 @@ XRRGetProviderResources(Display *dpy, Window window) return NULL; } + xrpr->max_master = rep.maxMaster; xrpr->timestamp = rep.timestamp; xrpr->nproviders = rep.nProviders; xrpr->flags = rep.flags; -- cgit v1.2.3