Skip to content

Conversation

@patrick96
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

Polling the XCB file descriptor for X events doesn't detect events that
are already in XCB's event queue but not yet handled.

If this happens, the eventloop polls for IO and the queued events wait
until another event arrives, causing some desyncs in the bar.

This can easily happen if something (e.g. a click event) triggers some
xcb calls, which as a consequence buffer some incoming events.

We "fix" this by adding a libuv prepare handle (which runs right before
polling for IO) that processes pending X events.

Related Issues & Documents

This caused some issues in #2609

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

Polling the XCB file descriptor for X events doesn't detect events that
are already in XCB's event queue but not yet handled.

If this happens, the eventloop polls for IO and the queued events wait
until another event arrives, causing some desyncs in the bar.

This can easily happen if something (e.g. a click event) triggers some
xcb calls, which as a consequence buffer some incoming events.

We "fix" this by adding a libuv prepare handle (which runs right before
polling for IO) that processes pending X events.
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Merging #2820 (7bc1d15) into master (053a7eb) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head 7bc1d15 differs from pull request most recent head 7bab54c. Consider uploading reports for the commit 7bab54c to get more accurate results

@@            Coverage Diff             @@
##           master    #2820      +/-   ##
==========================================
- Coverage   13.44%   13.42%   -0.02%     
==========================================
  Files         151      151              
  Lines       11465    11482      +17     
==========================================
  Hits         1541     1541              
- Misses       9924     9941      +17     
Flag Coverage Δ
unittests 13.42% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/components/eventloop.hpp 0.00% <ø> (ø)
src/components/controller.cpp 0.00% <0.00%> (ø)
src/components/eventloop.cpp 0.00% <0.00%> (ø)
src/components/screen.cpp 0.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@patrick96 patrick96 merged commit 1d4e30c into polybar:master Sep 13, 2022
@patrick96 patrick96 deleted the fix/xcb-queued branch September 13, 2022 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant