[PATCH] libx11-1.6.7: Flush buffer in time for global (un)lock xserver operation

Chen Gang chengang at emindsoft.com.cn
Wed Nov 27 03:47:27 UTC 2019


The global (un)lock xserver operations will have effect to the whole
system, and all the other gui apps have to be blocked, so the operations
should not be buffered, or may cause sync issue, e.g. reboot machine.

Signed-off-by: Chen Gang <chengang at emindsoft.com.cn>
---
 src/GrServer.c  | 1 +
 src/UngrabSvr.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/GrServer.c b/src/GrServer.c
index c4c62be..59ed03a 100644
--- a/src/GrServer.c
+++ b/src/GrServer.c
@@ -35,6 +35,7 @@ XGrabServer (register Display *dpy)
 	_X_UNUSED register xReq *req;
 	LockDisplay(dpy);
         GetEmptyReq(GrabServer, req);
+	XFlush(dpy); /* For Global (un)lock ops must be sent quickly */
 	UnlockDisplay(dpy);
 	SyncHandle();
 	return 1;
diff --git a/src/UngrabSvr.c b/src/UngrabSvr.c
index 20ad9aa..4b0ffca 100644
--- a/src/UngrabSvr.c
+++ b/src/UngrabSvr.c
@@ -37,6 +37,7 @@ XUngrabServer (

         LockDisplay(dpy);
         GetEmptyReq(UngrabServer, req);
+       XFlush(dpy); /* For Global (un)lock ops must be sent quickly */
         UnlockDisplay(dpy);
 	SyncHandle();
 	return 1;




More information about the xorg-devel mailing list