mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[PR #679] [MERGED] XWindowsEventQueueBuffer: Fix delays when waiting for new events #1674
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#1674
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/debauchee/barrier/pull/679
Author: @p12tic
Created: 5/20/2020
Status: ✅ Merged
Merged: 5/30/2020
Merged by: @shymega
Base:
master← Head:x11-fix-event-wait-race-condition📝 Commits (1)
722b7d6XWindowsEventQueueBuffer: Fix delays when waiting for new events📊 Changes
2 files changed (+16 additions, -1 deletions)
View changed files
📝
src/lib/platform/XWindowsEventQueueBuffer.cpp(+14 -1)📝
src/lib/platform/XWindowsEventQueueBuffer.h(+2 -0)📄 Description
Fixes #617, #298, #58, https://github.com/symless/synergy-core/issues/6487.
This PR fixes intermittent waits on Linux client. These were caused by the wait loop in
XWindowsEventQueueBufferwhere we wait for new events. The problem was that we useQLength()to check if there are new events coming from the X11 server. This is insufficient, because it checks only for messages that the XLib already knows about.Consider the situation when we have no pending events at all and we enter the wait loop. An event arrives in the socket, we are woken up and go on to check
QLength(). It will return 0, because the socket itself was not read by XLib. If we call XPending() instead, the socket would be read as we expect, the event would become visible to XLib, XPending() would return nonzero value and we would exit the event loop.Tested for a couple of days, did not see problems on my local workstation. The fix need further testing, maybe there are other related issues that I have not noticed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.