#4768 Workaround locking issue in X11 getCurrentTime()

This commit is contained in:
Andrew Nelless 2016-08-08 11:23:59 +01:00 committed by Jerry (Xinyu Hou)
parent 7fa92869a4
commit f6e1dd51fa
1 changed files with 2 additions and 0 deletions

View File

@ -1432,6 +1432,7 @@ XWindowsUtil::getCurrentTime(Display* display, Window window)
// select property events on window
XWindowAttributes attr;
XGetWindowAttributes(display, window, &attr);
XLockDisplay(display);
XSelectInput(display, window, attr.your_event_mask | PropertyChangeMask);
// make a property name to receive dummy change
@ -1459,6 +1460,7 @@ XWindowsUtil::getCurrentTime(Display* display, Window window)
// restore event mask
XSelectInput(display, window, attr.your_event_mask);
XUnlockDisplay(display);
return xevent.xproperty.time;
}