summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Phan <phanquangminh217@gmail.com>2022-11-29 19:35:13 +0700
committerOlivier Fourdan <ofourdan@redhat.com>2023-02-23 16:09:41 +0100
commit7d039914ff5baf1ebd5dca1ddcb8d3a74ba3587e (patch)
treea43aeaffa8f3393a304e9d59cd6013c464028169
parentcedf933c7cbbc0285e7f9ddb17706b9a8d84f6aa (diff)
downloadxserver-7d039914ff5baf1ebd5dca1ddcb8d3a74ba3587e.tar.gz
randr: introduce rrCrtcGetInfo DDX function
This allows rrCrtcGetInfo to override the values in the XRRCrtcGetInfo reply. One use case is to allow Xwayland to return the current emulated mode for the specific client instead of the global mode. Signed-off-by: Minh Phan <phanquangminh217@gmail.com> Acked-by: Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 5145742fb6e3d108b05db1521b51112e0dbfb95a)
-rw-r--r--randr/randrstr.h8
-rw-r--r--randr/rrcrtc.c3
2 files changed, 11 insertions, 0 deletions
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 173ecdf4e..545348835 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -218,6 +218,10 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
Rotation rotation,
int numOutputs, RROutputPtr * outputs);
+typedef void (*RRCrtcGetProcPtr) (ScreenPtr pScreen,
+ RRCrtcPtr crtc,
+ xRRGetCrtcInfoReply *rep);
+
typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
@@ -420,6 +424,10 @@ typedef struct _rrScrPriv {
RRRequestLeaseProcPtr rrRequestLease;
RRGetLeaseProcPtr rrGetLease;
+
+#if RANDR_12_INTERFACE
+ RRCrtcGetProcPtr rrCrtcGet;
+#endif
} rrScrPrivRec, *rrScrPrivPtr;
extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index e64f03131..5f85bdfa5 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1269,6 +1269,9 @@ ProcRRGetCrtcInfo(ClientPtr client)
}
}
+ if (pScrPriv->rrCrtcGet)
+ pScrPriv->rrCrtcGet(pScreen, crtc, &rep);
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);