Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclusive XInput event handling #1821

Merged
merged 8 commits into from
Apr 17, 2024
Merged

Exclusive XInput event handling #1821

merged 8 commits into from
Apr 17, 2024

Conversation

Caellian
Copy link
Collaborator

@Caellian Caellian commented Apr 13, 2024

This commit builds upon #1819 and makes conky use only XInput for mouse events if BUILD_MOUSE_EVENTS is enabled.

This PR makes conky only propagate basic X11 mouse events, because constructing XInput events is a bit tricky (or impossible):

  • We can't just forward the event we've received because XInput stores event details in a cookie which can't be claimed multiple times.
  • We can't pass them through and ignore them.
  • I'm still looking into ways of constructing XInput events.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@github-actions github-actions bot added the sources PR modifies project sources label Apr 13, 2024
Copy link

netlify bot commented Apr 13, 2024

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit d5af5ac
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/661f2c859262eb0008b9ed94

@Caellian Caellian mentioned this pull request Apr 13, 2024
@Caellian Caellian linked an issue Apr 13, 2024 that may be closed by this pull request
@Caellian Caellian changed the title Add full XInput event handling Exclusive XInput event handling Apr 13, 2024
@brndnmtthws
Copy link
Owner

Do you have an ETA on when you might be finished this? I was thinking of cutting a new release in the next few days, but I will wait if you will be done soon.

@Caellian
Copy link
Collaborator Author

Caellian commented Apr 13, 2024

Do you have an ETA on when you might be finished this?

I expect within the following 2-3 days. There's a quirk I need to figure out a workaround for (working on that currently), other than that it's pretty much done. The PR doesn't introduce any functionality though, it just switches to a newer event system on X11 - not sure if that plays a role in your decision.

WIP commit - I broke something and events no longer get reported.

On a flip side, valuators can be referenced by either a name string or number
id now, use of which is easy to optimize by the compiler.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Added support for changing valuator properties through xorg.conf.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian Caellian force-pushed the dev/xinput-event-handling branch 3 times, most recently from 54bf801 to 38c27c4 Compare April 16, 2024 23:11
WIP commit - relative calculation is still off.

Calculate relative valuators only once per event and cache results.

Switch to finding top-level window before root. This made me reuse
virtual root code so I refactored it and made it apply automatically in
place of X11 macros. This means that all code in x11.cc will use virtual
roots if they exist.

Fixed query_x11_windows fallback to exclude windows without WM hints. I
believe this is the correct way to ignore windows specific to some
special WM functionality.

Removed InputEvent and xev_as_input_event as they were being used in
only a single place.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian Caellian force-pushed the dev/xinput-event-handling branch from 38c27c4 to db70a1b Compare April 16, 2024 23:14
Wasn't updated due to implicit reference copy. Now relative seems to
work.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian Caellian marked this pull request as ready for review April 17, 2024 00:07
First reported event was being reported with bad computed relative value
otherwise.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian Caellian merged commit f4b3229 into main Apr 17, 2024
62 checks passed
@Caellian Caellian deleted the dev/xinput-event-handling branch April 17, 2024 02:04
@jborme
Copy link

jborme commented Apr 21, 2024

This commit causes me trouble. With fluxbox as WM, a right click on the root window leads to 3 second delay waiting for the WM right-click menu to appear, with 100% CPU in the meantime.
I bisected the problem to f4b3229

@Caellian
Copy link
Collaborator Author

You can build with BUILD_XINPUT disabled for now if that's the case. Thanks for reporting this, I will be able to investigate and fix it in a week or so.

Time to install yet another X11 WM... 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sources PR modifies project sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how to make conky consistenly pass clicks to the root window #320
3 participants