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

Forward XInput events #1807

Closed
wants to merge 26 commits into from
Closed

Forward XInput events #1807

wants to merge 26 commits into from

Conversation

Caellian
Copy link
Collaborator

@Caellian Caellian commented Apr 8, 2024

This PR fixes propagation of mouse events to gdk applications (e.g. caja).

It builds on top of #1802.

Events now get correctly propagated to a window (or root if none) behind conky.
This was a necessary change to handle cases such as MATE+caja where caja
is used between conky and background to show icons and desktop menu.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Atoms should be faster than graph traversal, and also don't include
decorations (windows) inserted by WM/DEs, nor special 1x1 windows.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Causes input focus flickering, especially with WMs where focus follows
pointer. This looks weird (carret flashing) and effectively acheives
nothing. So I'm, leaving it up to WMs to manage focus.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
display_output_x11::main_loop_wait was getting long and hard to read.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
I think splitting it out into separate functions makes each part much
clearer and easier to follow, as well as reducing the complexity of
define conditions

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@github-actions github-actions bot added the sources PR modifies project sources label Apr 8, 2024
@Caellian Caellian linked an issue Apr 8, 2024 that may be closed by this pull request
Copy link

netlify bot commented Apr 8, 2024

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit 3dd393f
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/6619c0a6d613c40007a454c5

`BUILD_XINPUT` feature should use xinput instead of old X11 input events
whenever possible. It's simpler to write now that it no longer makes
main_loop_wait 100LoC larger.

Also added proper valuator resolution by name, these values are mostly
the same, but some devices might have unexpected indices. Ideally, names
should also be configurable at runtime.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
XSendEvent propagate bool argument is actually "don't force propagation", so
True value means the event will only get propagated if it's not handled,
and False means the event will _always_ get propagated.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Now handling mouse events on "override" windows with XInput which means
that XInput allows us to fully support them on all window types.

Previous commit contained a rough layout of everything needed, it's now been
fixed (there were several bugs) and tested (Openbox).

Added debounce to XInput events because they were getting reported twice
with exact same data (including serial no.).

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Cookie pointer turns into nullptr (didn't free it) right before
`propagate_x11_event` call somehow, so I'm deep-copying data to pass into
propagation function.

For now I'm only sending basic X11 events, have to figure out how to
send XInput ones. Basic events need to be constructed anyway as we're
blocking the surface below from recieving them.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Leaked from testing for unrelated issue.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Doesn't crash. Scrolling is wrong though (at least for me), because
"Rel[ative]" valuators, with `Mode: relative` are in fact absolute.

Propagation of constructed basic events works.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Events now get correctly propagated to a window (or root if none) behind conky.
This was a necessary change to handle cases such as MATE+caja where caja
is used between conky and background to show icons and desktop menu.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Atoms should be faster than graph traversal, and also don't include
decorations (windows) inserted by WM/DEs, nor special 1x1 windows.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Causes input focus flickering, especially with WMs where focus follows
pointer. This looks weird (carret flashing) and effectively acheives
nothing. So I'm, leaving it up to WMs to manage focus.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
display_output_x11::main_loop_wait was getting long and hard to read.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
I think splitting it out into separate functions makes each part much
clearer and easier to follow, as well as reducing the complexity of
define conditions

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian Caellian changed the base branch from main to fix/separate-x11-events April 12, 2024 05:27
This commit is final refactor commit that's fully functional and
contains fixes to old bugs and previously introduced regressions.

There's some extra arguments (cookie) that aren't used yet, but will be
in commits that succeed this one.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
This commit is final refactor commit that's fully functional and
contains fixes to old bugs and previously introduced regressions.

There's some extra arguments (cookie) that aren't used yet, but will be
in commits that succeed this one.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Base automatically changed from fix/separate-x11-events to main April 12, 2024 14:46
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Move event handling code into separate functions.
@Caellian
Copy link
Collaborator Author

Due to rewriting parts of the history of this branch, it's got a lot of diverging commits from main and it would be a lot of work trying to consolidate them into a common history. Created a new branch and PR (#1821), so I'm moving the development there.

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.

1 participant