summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-01-23 16:06:56 +0000
committerDave Airlie <airlied@redhat.com>2012-01-23 16:06:56 +0000
commit3a3f8782dbcbac6755946a5b264424f304f20651 (patch)
tree1490ec7de41999c544c9d8a9658d9f8308d74720
parent9a35ea3328d3cc5502d5702aee7e8f954243922f (diff)
add set provider roledrvmodel
-rw-r--r--include/X11/extensions/Xrandr.h4
-rw-r--r--src/XrrProvider.c19
2 files changed, 23 insertions, 0 deletions
diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 8216bd3..034fb4c 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -478,6 +478,10 @@ XRRGetProviderInfo(Display *dpy, XID provider);
void
XRRFreeProviderInfo(XRRProviderInfo *provider);
+void
+XRRSetProviderRole(Display *dpy, XID provider,
+ int new_role, int switch_master);
+
_XFUNCPROTOEND
#endif /* _XRANDR_H_ */
diff --git a/src/XrrProvider.c b/src/XrrProvider.c
index 5a264ee..e1b83ba 100644
--- a/src/XrrProvider.c
+++ b/src/XrrProvider.c
@@ -140,3 +140,22 @@ XRRFreeProviderInfo(XRRProviderInfo *provider)
{
free(provider);
}
+
+void
+XRRSetProviderRole(Display *dpy, XID provider,
+ int new_role, int switch_master)
+{
+ XExtDisplayInfo *info = XRRFindDisplay(dpy);
+ xRRSetProviderRoleReq *req;
+
+ RRCheckExtension(dpy, info, NULL);
+ LockDisplay (dpy);
+ GetReq (RRSetProviderRole, req);
+ req->reqType = info->codes->major_opcode;
+ req->randrReqType = X_RRSetProviderRole;
+ req->provider = provider;
+ req->new_role = new_role;
+ req->exclusive_master = switch_master;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+}