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.

Caellian added 7 commits April 6, 2024 17:45
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Tin Švagelj <[email protected]>
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 <[email protected]>
display_output_x11::main_loop_wait was getting long and hard to read.

Signed-off-by: Tin Švagelj <[email protected]>
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 <[email protected]>
@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

@Caellian Caellian force-pushed the dev/better-event-passing branch from 897a5c2 to 1a6a8e0 Compare April 9, 2024 00:53
`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 <[email protected]>
@Caellian Caellian force-pushed the dev/better-event-passing branch from 1a6a8e0 to c244e3f Compare April 9, 2024 18:48
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Leaked from testing for unrelated issue.

Signed-off-by: Tin Švagelj <[email protected]>
@Caellian Caellian force-pushed the dev/better-event-passing branch from 14ebb44 to dc0e056 Compare April 11, 2024 06:03
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Tin Švagelj <[email protected]>
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 <[email protected]>
display_output_x11::main_loop_wait was getting long and hard to read.

Signed-off-by: Tin Švagelj <[email protected]>
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 <[email protected]>
@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 <[email protected]>
@Caellian Caellian force-pushed the fix/separate-x11-events branch from f613160 to 57efc63 Compare April 12, 2024 05:48
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 <[email protected]>
@Caellian Caellian force-pushed the fix/separate-x11-events branch from 57efc63 to cfdf5ac Compare April 12, 2024 12:13
Base automatically changed from fix/separate-x11-events to main April 12, 2024 14:46
Move event handling code into separate functions.
@Caellian Caellian force-pushed the dev/better-event-passing branch from f923045 to 3dd393f Compare April 12, 2024 23:15
@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.

@Caellian Caellian closed this Apr 13, 2024
@Caellian Caellian deleted the dev/better-event-passing branch April 17, 2024 05:20
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