diff options
-rw-r--r-- | include/X11/extensions/Xrandr.h | 4 | ||||
-rw-r--r-- | src/XrrProvider.c | 19 |
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 (); +} |