mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-30 01:53:17 +03:00
#4768 Workaround locking issue in X11 getCurrentTime()
This commit is contained in:
parent
7fa92869a4
commit
f6e1dd51fa
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user