mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-11 22:25:53 +08:00
#6409 Time out read events for clipboard
This commit is contained in:
committed by
Jnewbon
parent
9ce4f867a1
commit
c8e1e036e2
@@ -1333,6 +1333,12 @@ XWindowsClipboard::CICCCMGetClipboard::readClipboard(Display* display,
|
||||
// process events if any otherwise sleep
|
||||
if (noWait || XPending(display) > 0) {
|
||||
while (!m_done && !m_failed && (noWait || XPending(display) > 0)) {
|
||||
// fail if timeout has expired
|
||||
if (timeout.getTime() >= s_timeout) {
|
||||
m_failed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
XNextEvent(display, &xevent);
|
||||
if (!processEvent(display, &xevent)) {
|
||||
// not processed so save it
|
||||
|
||||
Reference in New Issue
Block a user