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

fix(gui): horizontal scrolling in linux #2229

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

Mino260806
Copy link
Contributor

@Mino260806 Mino260806 commented Jul 31, 2024

I had to dig in intellij community source code, as horizontal scrolling works fine there and it also happens to use Java AWT.

I attached jdb debugger to intellij and put a breakpoint on "MouseWheelEvent", simulated horizontal scroll, and it lead me to the code snippets below :

Here's how it's handled in intellij

https://github.com/JetBrains/intellij-community/blob/654dcd7a253d7f527b1d4d6d17be532a40775b1d/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.kt#L1032-L1049

https://github.com/JetBrains/intellij-community/blob/654dcd7a253d7f527b1d4d6d17be532a40775b1d/platform/util/ui/src/com/intellij/util/ui/StartupUiUtil.kt#L184-L189

I copied these three methods in this commit to a custom JadxEventQueue, should I mention the original sources in the code ?

Anyway, horizontal scrolling is now working as expected


@skylot
Copy link
Owner

skylot commented Jul 31, 2024

This looks like a black magic to me 🤣
Also, as I remember, mouse buttons number after 3 not fixed and may change depending on hardware.
Anyway, if this works for IntelliJ users and resolve issue for you, so this is fine to merge.
@Mino260806 thank you for your research 👍

@skylot skylot merged commit bda3119 into skylot:master Jul 31, 2024
5 checks passed
@Mino260806 Mino260806 deleted the fix_horizontal_scroll_linux branch August 1, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants