[PATCH] Flush buffer in time for global (un)lock xserver operation
chengang at emindsoft.com.cn
chengang at emindsoft.com.cn
Wed Dec 4 10:24:27 UTC 2019
From: Chen Gang <chengang at emindsoft.com.cn>
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.
Cc: Lv Li-song <lvlisong at emindsoft.com.cn>
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 c4c62bef..8f81157c 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 20ad9aa3..49c8b9af 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;
--
2.20.1
More information about the xorg-devel
mailing list