From 3a3f8782dbcbac6755946a5b264424f304f20651 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 23 Jan 2012 16:06:56 +0000 Subject: add set provider role --- include/X11/extensions/Xrandr.h | 4 ++++ src/XrrProvider.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) 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 (); +} -- cgit v1.2.3